Testing: grib_util_set_spec packing types

This commit is contained in:
Shahram Najm 2024-01-14 14:39:46 +00:00
parent 1f6f592e57
commit bc8362f985
2 changed files with 16 additions and 0 deletions

View File

@ -27,6 +27,8 @@ static int get_packing_type_code(const char* packingType)
return GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER;
else if (STR_EQUAL(packingType, "grid_ieee"))
return GRIB_UTIL_PACKING_TYPE_IEEE;
else if (STR_EQUAL(packingType, "grid_complex"))
return GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX;
Assert(!"Invalid packingType");
return result;

View File

@ -74,6 +74,20 @@ if [ $HAVE_AEC -eq 1 ]; then
grib_check_key_equals $outfile packingType grid_simple
fi
infile=${data_dir}/sample.grib2
$EXEC $grib_util_set_spec -p grid_ieee $infile $outfile
grib_check_key_equals $outfile 'packingType,precision' 'grid_ieee 1'
infile=${data_dir}/sample.grib2
$EXEC $grib_util_set_spec -p grid_second_order $infile $outfile
grib_check_key_equals $outfile 'packingType' 'grid_second_order'
infile=${data_dir}/sample.grib2
$EXEC $grib_util_set_spec -p grid_complex $infile $outfile
# $tools_dir/grib_ls $outfile
grib_check_key_equals $outfile 'packingType' 'grid_complex'
# --------------------------------------------------
# Reduced Gaussian Grid N=32 second order packing
# --------------------------------------------------