From c8cb203ee3f8b8095e4457d4bfb9981d251b21b4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 5 Jul 2016 15:44:55 +0100 Subject: [PATCH] ECC-288: bufr_compare -R key=tolerance does not work --- tests/CMakeLists.txt | 1 + tests/ecc-288.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ tools/bufr_compare.c | 10 ++++++++++ 3 files changed, 53 insertions(+) create mode 100755 tests/ecc-288.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 527941f75..f00f142b4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -57,6 +57,7 @@ list( APPEND tests2 bufr_change_edition ecc-197 ecc-286 + ecc-288 gts_get gts_ls gts_compare diff --git a/tests/ecc-288.sh b/tests/ecc-288.sh new file mode 100755 index 000000000..226273da0 --- /dev/null +++ b/tests/ecc-288.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Copyright 2005-2016 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.sh + +# --------------------------------------------------------- +# This is the test for the JIRA issue ECC-288 +# It tests bufr_compare with a relative tolerance +# --------------------------------------------------------- +cd ${data_dir}/bufr +label="ecc_288_test" + +tempRules=temp.${label}.filter +tempOut=temp.${label}.out +BufrFile=syno_1.bufr + +cat > $tempRules <tolerance_count=MAX_KEYS; + ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count)); + if (ret == GRIB_INVALID_ARGUMENT) { + usage(); + exit(1); + } + } + { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ /* with the same name as first file in that directory */