Testing: 'close' action and filepool

This commit is contained in:
Shahram Najm 2023-12-26 14:52:23 +00:00
parent 0c747f3b02
commit c2668153ef
2 changed files with 21 additions and 0 deletions

View File

@ -344,6 +344,11 @@ grib_file* grib_get_file(const char* filename, int* err)
{
grib_file* file = NULL;
if (!file_pool.current) {
*err = GRIB_IO_PROBLEM;
return NULL;
}
if (file_pool.current->name && !grib_inline_strcmp(filename, file_pool.current->name)) {
return file_pool.current;
}

View File

@ -90,5 +90,21 @@ set -e
grep -q "Cannot include file" $tempErr
# Close
# --------
cat > $fRules <<EOF
transient abcd = "afile";
close(abcd);
EOF
set +e
${tools_dir}/bufr_filter $fRules $ECCODES_SAMPLES_PATH/BUFR4.tmpl > $tempErr 2>&1
status=$?
set -e
[ $status -ne 0 ]
cat $tempErr
grep -q "Input output problem" $tempErr
# Clean up
rm -f $fLog $fRules $tempErr