diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index 819900b15..882fa3293 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -177,10 +177,11 @@ ${tools_dir}/bufr_set -s section2Present=1 $f $fBufrTmp ${tools_dir}/bufr_compare $f $fBufrTmp # Compare with -2 option set +e -${tools_dir}/bufr_compare -2 $f $fBufrTmp > $fLog 2>&1 +${tools_dir}/bufr_compare -2 -v $f $fBufrTmp > $fLog 2>&1 status=$? set -e [ $status -eq 1 ] +grep Swapping $fLog #---------------------------------------------------- # ECC-656: using relative comparison (-R) with 'all' diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh index 33655a60a..ef84af3f1 100755 --- a/tests/grib_dump.sh +++ b/tests/grib_dump.sh @@ -106,8 +106,12 @@ grep -q "dataDate = 19090206" $temp # Skip handle ${tools_dir}/grib_dump -w count=4 $file > $temp 2>&1 -ECCODES_DEBUG=1 ${tools_dir}/grib_dump $data_dir/sample.grib2 +ECCODES_DEBUG=1 ${tools_dir}/grib_dump $data_dir/sample.grib2 > $temp 2>&1 +# Error conditions +#----------------------------------------------------------- +${tools_dir}/grib_dump -p nonexist $file > $temp 2>&1 +grep -q "Key/value not found" $temp # Unreadable message #----------------------------------------------------------- diff --git a/tests/gts_dump.sh b/tests/gts_dump.sh index 21733d0a6..8303e03b6 100755 --- a/tests/gts_dump.sh +++ b/tests/gts_dump.sh @@ -22,7 +22,14 @@ gts_file=EGRR20150317121020_00493212.DAT ${tools_dir}/gts_dump -w count=1 $gts_file ${tools_dir}/gts_dump -w count=2 $gts_file ${tools_dir}/gts_dump -Dat $gts_file -${tools_dir}/gts_dump -OH $gts_file +${tools_dir}/gts_dump -OH $gts_file +${tools_dir}/gts_dump -d $gts_file + +set +e +${tools_dir}/gts_dump -OD $gts_file +status=$? +set -e +[ $status -ne 0 ] # Clean up rm -f $fLog $fTmp diff --git a/tools/bufr_compare.cc b/tools/bufr_compare.cc index d2d1f0e7a..9a59a9149 100644 --- a/tools/bufr_compare.cc +++ b/tools/bufr_compare.cc @@ -778,19 +778,17 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g if (options->mode != MODE_BUFR) { /* TODO: Ignore missing values for keys in BUFR. Not yet implemented */ - isMissing1 = ((grib_is_missing(handle1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; - isMissing2 = ((grib_is_missing(handle2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; + //isMissing1 = ((grib_is_missing(handle1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; + //isMissing2 = ((grib_is_missing(handle2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; } if ((isMissing1 == 1) && (isMissing2 == 1)) { - if (verbose) - printf(" is set to missing in both fields\n"); + // if (verbose) printf(" is set to missing in both fields\n"); return GRIB_SUCCESS; } if (isMissing1 == 1) { - if (verbose) - printf(" is set to missing in %s field\n", first_str); + // if (verbose) printf(" is set to missing in %s field\n", first_str); printInfo(handle1); printf("%s is set to missing in %s field is not missing in %s field\n", name, first_str, second_str); err1 = GRIB_VALUE_MISMATCH; @@ -799,8 +797,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g } if (isMissing2 == 1) { - if (verbose) - printf(" is set to missing in %s field\n", first_str); + // if (verbose) printf(" is set to missing in %s field\n", first_str); printInfo(handle1); printf("%s is set to missing in %s field is not missing in %s field\n", name, second_str, first_str); err1 = GRIB_VALUE_MISMATCH; @@ -1089,8 +1086,6 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g break; case GRIB_TYPE_BYTES: - if (verbose) - printf(" as bytes\n"); if (options->mode == MODE_BUFR) return 0; break; diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index fef2950e0..be3891497 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -450,7 +450,8 @@ static int navigate(grib_field_tree* fields, grib_runtime_options* options) message_type = CODES_BUFR; break; default: - Assert(0); + fprintf(stderr, "%s %s: Invalid mode", tool_name, __func__); + exit(1); } if (fields->field) { diff --git a/tools/metar_copy.cc b/tools/metar_copy.cc index 9e4e14ef7..ff46dd0e1 100644 --- a/tools/metar_copy.cc +++ b/tools/metar_copy.cc @@ -72,14 +72,15 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err = 0; - if (!options->skip) { - if (options->set_values_count != 0) - err = grib_set_values(h, options->set_values, options->set_values_count); + Assert(options->set_values_count==0); // Cannot set keys in this tool - if (err != GRIB_SUCCESS && options->fail) - exit(err); - } + // int err = 0; + // if (!options->skip) { + // if (options->set_values_count != 0) + // err = grib_set_values(h, options->set_values, options->set_values_count); + // if (err != GRIB_SUCCESS && options->fail) + // exit(err); + // } grib_tools_write_message(options, h); return 0;