From 1f335a011e88e85c4a6909cdbad071581fd25b48 Mon Sep 17 00:00:00 2001 From: shahramn Date: Wed, 1 May 2024 21:53:06 +0100 Subject: [PATCH] Testing: big2gribex --- tests/CMakeLists.txt | 1 + tests/big2gribex.sh | 23 +++++++++++++++++++++++ tools/big2gribex.cc | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) create mode 100755 tests/big2gribex.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 43dd441cd..1508b820a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -228,6 +228,7 @@ if( HAVE_BUILD_TOOLS ) grib_geo_iter grib_to_json grib_to_ppm + big2gribex grib_sub_area_check grib_list_keys grib_histogram diff --git a/tests/big2gribex.sh b/tests/big2gribex.sh new file mode 100755 index 000000000..c8c0b6098 --- /dev/null +++ b/tests/big2gribex.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="big2gribex_test" +tempGrib=temp.$label.grib + +if [ ! -x ${tools_dir}/big2gribex ]; then + exit 0 +fi + +${tools_dir}/big2gribex $data_dir/test.grib1 $tempGrib + +# Clean up +rm -f $tempGrib diff --git a/tools/big2gribex.cc b/tools/big2gribex.cc index a36b01126..c2797a821 100644 --- a/tools/big2gribex.cc +++ b/tools/big2gribex.cc @@ -8,18 +8,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/* - * Implementation: big2gribex - * - * Description: - * - */ - #include #include #include "grib_api.h" -void usage(char*); + +static void usage(const char* progname) +{ + printf("\nUsage: %s grib_in grib_out\n", progname); + exit(1); +} int main(int argc, char* argv[]) { @@ -70,12 +68,5 @@ int main(int argc, char* argv[]) exit(1); } - return 0; } - -void usage(char* progname) -{ - printf("\nUsage: %s grib_in grib_out\n", progname); - exit(1); -}