From 089604ec0352f29ffd953d4f139ce289abd0a1b5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 29 Nov 2019 14:45:55 +0000 Subject: [PATCH] ECC-992: Renamed environment variable --- src/grib_context.c | 8 ++++---- tests/grib_data_quality_checks.sh | 26 ++++++++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/grib_context.c b/src/grib_context.c index e4a0aab5e..e2616c08d 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -461,12 +461,12 @@ grib_context* grib_context_get_default() } } - /* Definitions path supplement: Added at the head of existing path */ + /* Definitions path extra: Added at the head of (i.e. before) existing path */ { - const char* defs_supp = codes_getenv("ECCODES_DEFINITION_PATH_SUPPLEMENT"); - if (defs_supp) { + const char* defs_extra = getenv("ECCODES_EXTRA_DEFINITION_PATH"); + if (defs_extra) { char buffer[DEF_PATH_MAXLEN]; - ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s:%s", defs_supp, default_grib_context.grib_definition_files_path); + ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s:%s", defs_extra, default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } } diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index b1bb3a558..05f1e1cac 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -14,20 +14,34 @@ set -u # Tests for data quality checks # --------------------------------------------------------- label="grib_data_quality" -tempOut=temp.${label}.out +tempOut=temp.1.${label}.out +temp2=temp.2.${label}.out tempErr=temp.${label}.err +# Start with clean environment +unset ECCODES_GRIB_DATA_QUALITY_CHECKS +unset ECCODES_EXTRA_DEFINITION_PATH + + input1=${data_dir}/reduced_gaussian_surface.grib1 input2=${data_dir}/reduced_gaussian_surface.grib2 grib_check_key_equals $input1 paramId 167 grib_check_key_equals $input2 paramId 167 -# Data quality checks disabled. Create cause huge values for temperature -unset ECCODES_GRIB_DATA_QUALITY_CHECKS +# Data quality checks disabled. Create huge values for temperature ${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut ${tools_dir}/grib_set -s scaleValuesBy=100 $input2 $tempOut -# Data quality checks enabled. Commands should fail +# Data quality checks enabled. Repacking should fail +export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 +set +e +${tools_dir}/grib_copy -r $tempOut /dev/null 2>$tempErr +status=$? +set -e +[ $status -ne 0 ] +grep -q 'outside allowable limits' $tempErr + +# Data quality checks enabled. Scaling should fail export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 set +e ${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut 2>$tempErr @@ -62,9 +76,9 @@ cat > $tempDir/param_limits.def <