mirror of https://github.com/ecmwf/eccodes.git
Testing: renamed double_cmp to grib_double_cmp
This commit is contained in:
parent
3d232fa190
commit
20eb277c9b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
|
@ -22,4 +22,4 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
${test_dir}/double_cmp ${infile}
|
||||
${test_dir}/grib_double_cmp ${infile}
|
Loading…
Reference in New Issue