Testing: Add test for switch statement on string key

This commit is contained in:
Shahram Najm 2023-04-16 16:28:46 +01:00
parent 7813fd1223
commit 25c72ac622
1 changed files with 10 additions and 1 deletions

View File

@ -199,11 +199,20 @@ cat >$tempFilt <<EOF
switch (edition) {
case 1: print "1";
case 2: print "2";
default: print "what is this?";assert(0);
default: print "[file]: what is this?"; assert(0);
}
EOF
${tools_dir}/grib_filter $tempFilt $ECCODES_SAMPLES_PATH/GRIB1.tmpl $ECCODES_SAMPLES_PATH/GRIB2.tmpl
cat >$tempFilt <<EOF
switch (packingType) {
case "grid_simple": print "simple";
case "grid_ccsds": print "ccsds";
case "spectral_complex": print "spectral";
default: print "[file]: what is this?"; assert(0);
}
EOF
${tools_dir}/grib_filter $tempFilt $data_dir/sample.grib2 ${data_dir}/ccsds.grib2 $data_dir/spherical_model_level.grib2
echo "Test MISSING"
# -----------------