Clang issue with local_MeteoFrance.c test with -fsanitize=memory

This commit is contained in:
Shahram Najm 2017-06-15 17:56:58 +01:00
parent 97e1dfd0ae
commit 8a0cd606e8
4 changed files with 11 additions and 4 deletions

View File

@ -36,6 +36,7 @@ if command -v pkg-config >/dev/null 2>&1; then
FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE`
#CMAKE_C_FLAGS=`grep CMAKE_C_FLAGS:STRING $CACHE_FILE | cut -d'=' -f2-`
#FLAGS_COMPILER="$FLAGS_COMPILER $CMAKE_C_FLAGS"
#FLAGS_COMPILER="$FLAGS_COMPILER -fsanitize=memory"
# The pkgconfig variables refer to the install directory. Change to build dir
BUILD_DIR=`grep -w eccodes_BINARY_DIR $CACHE_FILE | cut -d'=' -f2`

View File

@ -36,7 +36,7 @@ if command -v pkg-config >/dev/null 2>&1; then
FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE`
FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE`
#CMAKE_C_FLAGS=`grep CMAKE_C_FLAGS:STRING $CACHE_FILE | cut -d'=' -f2-`
#FLAGS_COMPILER="$FLAGS_COMPILER $CMAKE_C_FLAGS"
#FLAGS_COMPILER="$FLAGS_COMPILER -fsanitize=memory"
# The pkgconfig variables refer to the install directory. Change to build dir
BUILD_DIR=`grep -w eccodes_BINARY_DIR $CACHE_FILE | cut -d'=' -f2`

View File

@ -848,9 +848,11 @@ int main (int argc, char * argv[])
grib_handle* h = NULL;
size_t len = 0;
GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "reduced_gg_ml_grib2")) == NULL), 0);
GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "regular_ll_pl_grib2")) == NULL), 0);
/*GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "reduced_gg_ml_grib2")) == NULL), 0);*/
len = strlen ("lambert");
GRIB_CHECK (grib_set_string (h, "gridType", "lambert", &len), 0);
GRIB_CHECK (grib_set_long (h, "centre", 85), 0);
GRIB_CHECK (grib_set_long (h, "grib2LocalSectionPresent", 1), 0);
@ -884,6 +886,9 @@ int main (int argc, char * argv[])
GRIB_CHECK (grib_set_long (h, "second", 0), 0);
len = strlen ("s");
GRIB_CHECK (grib_set_string (h, "indicatorOfUnitOfTimeRange", "s", &len), 0);
GRIB_CHECK (grib_set_long (h, "scaledValueOfFirstFixedSurface", 0), 0);
len = strlen ("s");
GRIB_CHECK (grib_set_string (h, "stepUnits", "s", &len), 0);
GRIB_CHECK (grib_set_long (h, "endStep", 3600), 0);
@ -900,7 +905,7 @@ int main (int argc, char * argv[])
GRIB_CHECK (grib_set_long (h, "LLCOSP", 0), 0);
GRIB_CHECK (grib_set_long (h, "INBITS", 16), 0);
/*GRIB_CHECK(grib_write_message(h, "output.meteoFrance.grib", "w"), 0);*/
GRIB_CHECK(grib_write_message(h, "output.local_MeteoFrance.grib", "w"), 0);
GRIB_CHECK (grib_handle_delete (h), 0);

View File

@ -10,4 +10,5 @@
. ./include.sh
exec ${test_dir}/local_MeteoFrance
${test_dir}/local_MeteoFrance
rm -f output.local_MeteoFrance.grib