summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/test_file_image.c8
-rw-r--r--hl/test/test_lite.c1
2 files changed, 6 insertions, 3 deletions
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 831fa23..9b18539 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -158,7 +158,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
FAIL_PUTS_ERROR("H5Dclose() failed");
/* get size of the file image i */
- if ((buf_size[i] = H5Fget_file_image(file_id[i], NULL, 0)) < 0)
+ if ((buf_size[i] = H5Fget_file_image(file_id[i], NULL, (size_t)0)) < 0)
FAIL_PUTS_ERROR("H5Fget_file_image() failed");
/* allocate buffer for the file image i */
@@ -370,7 +370,9 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
H5Aclose(attr_id);
} H5E_END_TRY;
#endif
- file_id[i] = -1;
+ if (H5Dclose(dset_id[i]) < 0)
+ FAIL_PUTS_ERROR("H5Dclose() failed");
+ dset_id[i] = -1;
} /* end if */
else {
/* write dataset without extending it */
@@ -399,7 +401,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
/* if opening the file image failed, continue next iteration */
- if ((file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
+ if ((dset_id[i] < 0) || (file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
continue;
/* open dataset in file image */
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 9d625e9..f3258d6 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -1282,6 +1282,7 @@ static int test_strings(void)
HDfree(dt_str);
goto out;
}
+ HDfree(dt_str);
/* Length of the character buffer is smaller then needed */
str_len = 21;