diff --git a/.gitignore b/.gitignore index 7593152e7..379036be1 100644 --- a/.gitignore +++ b/.gitignore @@ -197,7 +197,7 @@ tests/*.sh.log tests/*.sh.trs tests/test-suite.log tests/bpv_limit -tests/double_cmp +tests/grib_double_cmp tests/gauss_sub tests/gribex_perf tests/index diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc83ca818..0b3286c4a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,7 +10,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_S # Build the executables used by test scripts ################################################ list( APPEND test_bins - double_cmp + grib_double_cmp read_any julian index @@ -40,7 +40,7 @@ list( APPEND tests1 uerra ) list( APPEND tests2 - double_cmp + grib_double_cmp bufr_dump bufrdc_desc_ref bufrdc_ref diff --git a/tests/Makefile.am b/tests/Makefile.am index 7828d84c8..58f0cf501 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -66,7 +66,7 @@ $(TESTS): download_data download_data: @$(top_srcdir)/data/download.sh $(top_srcdir)/data -noinst_PROGRAMS = packing_check gauss_sub read_any double_cmp packing pack_unpack \ +noinst_PROGRAMS = packing_check gauss_sub read_any grib_double_cmp packing pack_unpack \ multi_from_message julian read_index index gribex_perf\ jpeg_perf ccsds_perf so_perf png_perf bpv_limit laplacian \ unit_tests grib_util_set_spec @@ -76,7 +76,7 @@ laplacian_SOURCES = laplacian.c packing_SOURCES = packing.c packing_check_SOURCES = packing_check.c read_any_SOURCES = read_any.c -double_cmp_SOURCES = double_cmp.c +grib_double_cmp_SOURCES = grib_double_cmp.c pack_unpack_SOURCES = pack_unpack.c julian_SOURCES = julian.c unit_tests_SOURCES = unit_tests.c diff --git a/tests/double_cmp.c b/tests/grib_double_cmp.c similarity index 89% rename from tests/double_cmp.c rename to tests/grib_double_cmp.c index 72cb2198b..51e181929 100644 --- a/tests/double_cmp.c +++ b/tests/grib_double_cmp.c @@ -9,8 +9,6 @@ */ /* - * C Implementation: double_cmp - * * Description: compare values retrieved with grib_get_double_array and * grib_get_double_element * @@ -26,13 +24,13 @@ void usage(char* prog) { int main(int argc, char** argv) { - int err = 0,i; + int err = 0,i = 0; double *values = NULL; size_t values_len= 0; double element_value=0; FILE* in = NULL; - char* filename ; + char* filename = NULL; grib_handle *h = NULL; if (argc<2) usage(argv[0]); @@ -48,6 +46,7 @@ int main(int argc, char** argv) h = grib_handle_new_from_file(0,in,&err); if (h == NULL) { printf("Error: unable to create handle from file %s\n",filename); + return 1; } /* get the size of the values array */ @@ -60,8 +59,8 @@ int main(int argc, char** argv) if (values_len < 100) exit(1); for (i = 0; i < 100; i++) { - /* get double element */ - GRIB_CHECK(grib_get_double_element(h,"values",i,&element_value),0); + /* get a particular data value */ + GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value),0); if (element_value != values[i]) { exit(1); diff --git a/tests/double_cmp.sh b/tests/grib_double_cmp.sh similarity index 94% rename from tests/double_cmp.sh rename to tests/grib_double_cmp.sh index d71437668..b84a4240f 100755 --- a/tests/double_cmp.sh +++ b/tests/grib_double_cmp.sh @@ -22,4 +22,4 @@ then exit 1 fi -${test_dir}/double_cmp ${infile} +${test_dir}/grib_double_cmp ${infile}