Testing: GRIB bitmap as string

This commit is contained in:
Shahram Najm 2024-01-29 12:30:49 +00:00
parent f3f13ba36d
commit 9a7842d549
2 changed files with 11 additions and 2 deletions

View File

@ -274,7 +274,7 @@ static void update_size(grib_accessor* a, size_t s)
static int unpack_string(grib_accessor* a, char* val, size_t* len)
{
int i = 0;
long i = 0;
grib_handle* hand = grib_handle_of_accessor(a);
if (len[0] < (a->length)) {
@ -284,8 +284,9 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
return GRIB_ARRAY_TOO_SMALL;
}
for (i = 0; i < a->length; i++)
for (i = 0; i < a->length; i++) {
val[i] = hand->buffer->data[a->offset + i];
}
len[0] = a->length;

View File

@ -156,5 +156,13 @@ set -e
grep -q "missing bitmap" $tempOut
# bitmap as string
cat > $tempRules<<EOF
print "[bitmap:s]";
EOF
${tools_dir}/grib_filter $tempRules $data_dir/boustrophedonic.grib1
${tools_dir}/grib_filter $tempRules $data_dir/missing_field.grib1
# Clean up
rm -f $tempData1 $tempData2 $temp1 $temp2 $tempRules $tempOut