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/*.sh.trs
|
||||||
tests/test-suite.log
|
tests/test-suite.log
|
||||||
tests/bpv_limit
|
tests/bpv_limit
|
||||||
tests/double_cmp
|
tests/grib_double_cmp
|
||||||
tests/gauss_sub
|
tests/gauss_sub
|
||||||
tests/gribex_perf
|
tests/gribex_perf
|
||||||
tests/index
|
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
|
# Build the executables used by test scripts
|
||||||
################################################
|
################################################
|
||||||
list( APPEND test_bins
|
list( APPEND test_bins
|
||||||
double_cmp
|
grib_double_cmp
|
||||||
read_any
|
read_any
|
||||||
julian
|
julian
|
||||||
index
|
index
|
||||||
|
@ -40,7 +40,7 @@ list( APPEND tests1
|
||||||
uerra
|
uerra
|
||||||
)
|
)
|
||||||
list( APPEND tests2
|
list( APPEND tests2
|
||||||
double_cmp
|
grib_double_cmp
|
||||||
bufr_dump
|
bufr_dump
|
||||||
bufrdc_desc_ref
|
bufrdc_desc_ref
|
||||||
bufrdc_ref
|
bufrdc_ref
|
||||||
|
|
|
@ -66,7 +66,7 @@ $(TESTS): download_data
|
||||||
download_data:
|
download_data:
|
||||||
@$(top_srcdir)/data/download.sh $(top_srcdir)/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\
|
multi_from_message julian read_index index gribex_perf\
|
||||||
jpeg_perf ccsds_perf so_perf png_perf bpv_limit laplacian \
|
jpeg_perf ccsds_perf so_perf png_perf bpv_limit laplacian \
|
||||||
unit_tests grib_util_set_spec
|
unit_tests grib_util_set_spec
|
||||||
|
@ -76,7 +76,7 @@ laplacian_SOURCES = laplacian.c
|
||||||
packing_SOURCES = packing.c
|
packing_SOURCES = packing.c
|
||||||
packing_check_SOURCES = packing_check.c
|
packing_check_SOURCES = packing_check.c
|
||||||
read_any_SOURCES = read_any.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
|
pack_unpack_SOURCES = pack_unpack.c
|
||||||
julian_SOURCES = julian.c
|
julian_SOURCES = julian.c
|
||||||
unit_tests_SOURCES = unit_tests.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
|
* Description: compare values retrieved with grib_get_double_array and
|
||||||
* grib_get_double_element
|
* grib_get_double_element
|
||||||
*
|
*
|
||||||
|
@ -26,13 +24,13 @@ void usage(char* prog) {
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int err = 0,i;
|
int err = 0,i = 0;
|
||||||
double *values = NULL;
|
double *values = NULL;
|
||||||
size_t values_len= 0;
|
size_t values_len= 0;
|
||||||
double element_value=0;
|
double element_value=0;
|
||||||
|
|
||||||
FILE* in = NULL;
|
FILE* in = NULL;
|
||||||
char* filename ;
|
char* filename = NULL;
|
||||||
grib_handle *h = NULL;
|
grib_handle *h = NULL;
|
||||||
|
|
||||||
if (argc<2) usage(argv[0]);
|
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);
|
h = grib_handle_new_from_file(0,in,&err);
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
printf("Error: unable to create handle from file %s\n",filename);
|
printf("Error: unable to create handle from file %s\n",filename);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the size of the values array */
|
/* get the size of the values array */
|
||||||
|
@ -60,8 +59,8 @@ int main(int argc, char** argv)
|
||||||
if (values_len < 100) exit(1);
|
if (values_len < 100) exit(1);
|
||||||
|
|
||||||
for (i = 0; i < 100; i++) {
|
for (i = 0; i < 100; i++) {
|
||||||
/* get double element */
|
/* get a particular data value */
|
||||||
GRIB_CHECK(grib_get_double_element(h,"values",i,&element_value),0);
|
GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value),0);
|
||||||
|
|
||||||
if (element_value != values[i]) {
|
if (element_value != values[i]) {
|
||||||
exit(1);
|
exit(1);
|
|
@ -22,4 +22,4 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${test_dir}/double_cmp ${infile}
|
${test_dir}/grib_double_cmp ${infile}
|
Loading…
Reference in New Issue