summaryrefslogtreecommitdiffstats
path: root/test/tfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tfile.c')
-rw-r--r--test/tfile.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/test/tfile.c b/test/tfile.c
index e3ff372..430bc85 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -5167,7 +5167,7 @@ test_libver_bounds_open(void)
/* Get new low bound and verify that it has been upgraded properly */
ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL);
CHECK(ret, FAIL, "H5Pget_libver_bounds");
- VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST");
+ VERIFY(new_low >= H5F_LIBVER_V110, TRUE, "Low bound should be upgraded to at least H5F_LIBVER_V110");
ret = H5Pclose(new_fapl);
CHECK(ret, FAIL, "H5Pclose");
@@ -5445,7 +5445,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
} H5E_END_TRY;
/* Get the internal file pointer if the create succeeds */
- if((ok = fid >= 0)) {
+ if(fid >= 0) {
f = (H5F_t *)H5VL_object(fid);
CHECK(f, NULL, "H5VL_object");
}
@@ -5456,34 +5456,35 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
if(is_swmr) { /* SWMR is enabled */
- if(high == H5F_LIBVER_LATEST) { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fcreate");
+ if(high >= H5F_LIBVER_V110) { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds");
- VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds");
} else /* Should fail */
- VERIFY(ok, FALSE, "H5Fcreate");
+ VERIFY(fid >= 0, FALSE, "H5Fcreate");
}
else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fcreate");
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
switch(low) {
case H5F_LIBVER_EARLIEST:
- ok = (f->shared->sblock->super_vers == 0 ||
- f->shared->sblock->super_vers == 1 ||
- f->shared->sblock->super_vers == 2);
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_DEF ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1 ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
break;
case H5F_LIBVER_V18:
- ok = (f->shared->sblock->super_vers == 2);
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
break;
case H5F_LIBVER_V110:
- ok = (f->shared->sblock->super_vers == 3);
+ case H5F_LIBVER_V112:
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_3);
VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
break;
@@ -5495,7 +5496,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
} /* end switch */
}
- if(ok) { /* Close the file */
+ if(fid >= 0) { /* Close the file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
}
@@ -5587,7 +5588,6 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
hid_t new_fapl = -1; /* File access property list */
unsigned super_vers; /* Superblock version */
H5F_libver_t low, high; /* Low and high bounds */
- hbool_t ok; /* The result is ok or not */
herr_t ret; /* Return value */
/* Create the file with the input fcpl and fapl */
@@ -5626,7 +5626,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
} H5E_END_TRY;
/* Get the internal file pointer if the open succeeds */
- if((ok = fid >= 0)) {
+ if(fid >= 0) {
f = (H5F_t *)H5VL_object(fid);
CHECK(f, NULL, "H5VL_object");
}
@@ -5634,26 +5634,24 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
/* Verify the file open succeeds or fails */
switch(super_vers) {
case 3:
- if(high == H5F_LIBVER_LATEST) {
+ if(high >= H5F_LIBVER_V110) {
/* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
- VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds");
/* Close the file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
} else /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
break;
case 2:
if(is_swmr) /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
-
- ok = f->shared->low_bound >= H5F_LIBVER_V18;
- VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V18, TRUE, "HDF5_superblock_ver_bounds");
/* Close the file */
ret = H5Fclose(fid);
@@ -5664,10 +5662,10 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
case 1:
case 0:
if(is_swmr) /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
- VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound, low, "HDF5_superblock_ver_bounds");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");