diff options
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 2698 |
1 files changed, 1605 insertions, 1093 deletions
diff --git a/test/tattr.c b/test/tattr.c index 2e391c5..d38fdaa 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -197,16 +197,24 @@ test_attr_basic_write(hid_t fapl) hsize_t dims3[] = {ATTR2_DIM1, ATTR2_DIM2}; int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int i; + bool vol_is_native; hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create file */ fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); + CHECK(h5_using_native_vol(fapl, fid1, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Create dataspace for dataset */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); CHECK(sid1, FAIL, "H5Screate_simple"); @@ -267,9 +275,11 @@ test_attr_basic_write(hid_t fapl) ret = H5Awrite(attr2, H5T_NATIVE_INT, attr_data1a); CHECK(ret, FAIL, "H5Awrite"); - /* Check storage size for attribute */ - attr_size = H5Aget_storage_size(attr); - VERIFY(attr_size, (ATTR1_DIM1 * sizeof(int)), "H5A_get_storage_size"); + if (vol_is_native) { + /* Check storage size for attribute */ + attr_size = H5Aget_storage_size(attr); + VERIFY(attr_size, (ATTR1_DIM1 * sizeof(int)), "H5A_get_storage_size"); + } /* Read attribute information immediately, without closing attribute */ ret = H5Aread(attr, H5T_NATIVE_INT, read_data1); @@ -388,9 +398,11 @@ test_attr_basic_write(hid_t fapl) attr = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check storage size for attribute */ - attr_size = H5Aget_storage_size(attr); - VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size"); + if (vol_is_native) { + /* Check storage size for attribute */ + attr_size = H5Aget_storage_size(attr); + VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size"); + } /* Try to create the same attribute again (should fail) */ H5E_BEGIN_TRY @@ -404,9 +416,11 @@ test_attr_basic_write(hid_t fapl) ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data2); CHECK(ret, FAIL, "H5Awrite"); - /* Check storage size for attribute */ - attr_size = H5Aget_storage_size(attr); - VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5A_get_storage_size"); + if (vol_is_native) { + /* Check storage size for attribute */ + attr_size = H5Aget_storage_size(attr); + VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5A_get_storage_size"); + } /* Close attribute */ ret = H5Aclose(attr); @@ -537,6 +551,12 @@ test_attr_flush(hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILL_VALUES) || + !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_MORE)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + fil = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fil, FAIL, "H5Fcreate"); @@ -728,6 +748,11 @@ test_attr_compound_write(hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create file */ fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); @@ -970,6 +995,11 @@ test_attr_scalar_write(hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create file */ fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); @@ -1113,6 +1143,11 @@ test_attr_mult_write(hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create file */ fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); @@ -1578,6 +1613,11 @@ test_attr_delete(hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Deletion Functions\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Open file */ fid1 = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); CHECK(fid1, FAIL, "H5Fopen"); @@ -1694,33 +1734,45 @@ test_attr_delete(hid_t fapl) static void test_attr_dtype_shared(hid_t fapl) { - hid_t file_id; /* File ID */ - hid_t dset_id; /* Dataset ID */ - hid_t space_id; /* Dataspace ID for dataset & attribute */ - hid_t type_id; /* Datatype ID for named datatype */ - hid_t attr_id; /* Attribute ID */ - int data = 8; /* Data to write */ - int rdata = 0; /* Read read in */ - H5O_info2_t oinfo; /* Object's information */ - h5_stat_size_t empty_filesize; /* Size of empty file */ - h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + hid_t file_id; /* File ID */ + hid_t dset_id; /* Dataset ID */ + hid_t space_id; /* Dataspace ID for dataset & attribute */ + hid_t type_id; /* Datatype ID for named datatype */ + hid_t attr_id; /* Attribute ID */ + int data = 8; /* Data to write */ + int rdata = 0; /* Read read in */ + H5O_info2_t oinfo; /* Object's information */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ + h5_stat_size_t filesize; /* Size of file after modifications */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || + !(vol_cap_flags_g & H5VL_CAP_FLAG_STORED_DATATYPES)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create a file */ file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(file_id, FAIL, "H5Fopen"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, file_id, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(file_id); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -1854,9 +1906,11 @@ test_attr_dtype_shared(hid_t fapl) ret = H5Fclose(file_id); CHECK(ret, FAIL, "H5Fclose"); - /* Check size of file */ - filesize = h5_get_file_size(FILENAME, fapl); - VERIFY(filesize, empty_filesize, "h5_get_file_size"); + if (vol_is_native) { + /* Check size of file */ + filesize = h5_get_file_size(FILENAME, fapl); + VERIFY(filesize, empty_filesize, "h5_get_file_size"); + } } /* test_attr_dtype_shared() */ /**************************************************************** @@ -2194,25 +2248,36 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -2244,9 +2309,11 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until just before converting to dense storage */ for (u = 0; u < max_compact; u++) { @@ -2264,9 +2331,11 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ @@ -2274,9 +2343,11 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Write data into the attribute */ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); @@ -2310,7 +2381,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -2336,9 +2407,10 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2347,14 +2419,19 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -2390,9 +2467,11 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until just before converting to dense storage */ for (u = 0; u < max_compact; u++) { @@ -2414,9 +2493,11 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "test_attr_dense_verify"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ @@ -2424,9 +2505,11 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Write data into the attribute */ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); @@ -2456,7 +2539,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -2482,10 +2565,11 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info2_t oinfo; /* Object info */ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT); + bool vol_is_native; herr_t ret; /* Generic return value */ /* Only run this test for sec2/default driver */ @@ -2509,14 +2593,19 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) if (use_min_dset_oh) CHECK(H5Pclose(fcpl), FAIL, "H5Pclose"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -2552,9 +2641,11 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until well into dense storage */ for (u = 0; u < (max_compact * 2); u++) { @@ -2577,9 +2668,11 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Close dataspace */ ret = H5Sclose(sid); @@ -2613,18 +2706,22 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "test_attr_dense_verify"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Delete one more attribute, which should cause reversion to compact storage */ snprintf(attrname, sizeof(attrname), "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Verify attributes still left */ ret = test_attr_dense_verify(dataset, (u - 1)); @@ -2635,9 +2732,11 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Verify attributes still left */ ret = test_attr_dense_verify(dataset, (u - 2)); @@ -2655,7 +2754,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -2681,13 +2780,14 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info2_t oinfo; /* Object info */ unsigned u; /* Local index variable */ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT); unsigned use_corder; /* Track creation order or not */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Only run this test for sec2/default driver */ if (!h5_using_default_driver(NULL)) @@ -2710,14 +2810,19 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) if (use_min_dset_oh) CHECK(H5Pclose(fcpl), FAIL, "H5Pclose"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -2753,9 +2858,11 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until well into dense storage */ for (u = 0; u < (max_compact * 2); u++) { @@ -2785,9 +2892,11 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Close Dataset */ ret = H5Dclose(dataset); @@ -2852,7 +2961,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -2878,11 +2987,12 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info2_t oinfo; /* Object info */ unsigned u; /* Local index variable */ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT); + bool vol_is_native; herr_t ret; /* Generic return value */ /* Only run this test for sec2/default driver */ @@ -2906,12 +3016,17 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) if (use_min_dset_oh) CHECK(H5Pclose(fcpl), FAIL, "H5Pclose"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -2943,9 +3058,11 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until well into dense storage */ for (u = 0; u < (max_compact * 2); u++) { @@ -2968,9 +3085,11 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Close dataspace */ ret = H5Sclose(sid); @@ -2992,16 +3111,18 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) ret = H5Ldelete(fid, DSET1_NAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Check on dataset's attribute storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + } /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -3027,9 +3148,10 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3038,14 +3160,19 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -3085,9 +3212,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add first attribute, which should be immediately in dense storage */ @@ -3105,9 +3234,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Add second attribute, to allow deletions to be checked easily */ @@ -3125,9 +3256,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Delete second attribute, attributes should still be stored densely */ @@ -3135,9 +3268,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Delete first attribute, attributes should not be stored densely */ @@ -3147,9 +3282,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Close dataspace */ ret = H5Sclose(sid); @@ -3167,7 +3304,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -3199,7 +3336,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) unsigned min_dense; /* Minimum # of attributes to store "densely" */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); @@ -3211,6 +3349,9 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); @@ -3245,9 +3386,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes, until just before converting to dense storage */ for (u = 0; u < max_compact; u++) { @@ -3265,9 +3408,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } /* end for */ - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add one more attribute, to push into "dense" storage */ /* Create dataspace for attribute */ @@ -3279,9 +3424,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open the attribute just created and get a second ID */ attr2 = H5Aopen(dataset, attrname, H5P_DEFAULT); @@ -3314,9 +3461,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open first attribute for the dataset */ attr = H5Aopen(dataset, attrname, H5P_DEFAULT); @@ -3366,9 +3515,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open first attribute for the dataset */ attr = H5Aopen(dataset, attrname, H5P_DEFAULT); @@ -3429,9 +3580,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open first attribute for the dataset */ attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4, H5P_DEFAULT, H5P_DEFAULT); @@ -3483,9 +3636,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open attribute of the dataset for the first time */ attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2, H5P_DEFAULT, H5P_DEFAULT); @@ -3497,9 +3652,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Adelete_by_idx"); } - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Open attribute for the second time */ attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2, H5P_DEFAULT, H5P_DEFAULT); @@ -3547,9 +3704,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Open attribute of the dataset for the first time */ attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3, H5P_DEFAULT, H5P_DEFAULT); @@ -3571,9 +3730,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open attribute for the second time */ attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3, H5P_DEFAULT, H5P_DEFAULT); @@ -3643,9 +3804,11 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) attr = H5Acreate2(gid1, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check on group's attribute storage status */ - is_dense = H5O__is_attr_dense_test(gid1); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on group's attribute storage status */ + is_dense = H5O__is_attr_dense_test(gid1); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Open the hard link just created */ gid2 = H5Gopen2(fid, GROUP2_NAME, H5P_DEFAULT); @@ -3720,9 +3883,10 @@ test_attr_big(hid_t fcpl, hid_t fapl) htri_t is_empty; /* Are there any attributes? */ htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing 'Big' Attributes in Dense Storage\n")); @@ -3731,14 +3895,19 @@ test_attr_big(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -3782,11 +3951,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add first "small" attribute, which should be in compact storage */ @@ -3800,11 +3971,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add second "small" attribute, which should stay in compact storage */ @@ -3818,11 +3991,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add first "big" attribute, which should push storage into dense form */ @@ -3842,10 +4017,12 @@ test_attr_big(hid_t fcpl, hid_t fapl) * message heap instead of forcing the attribute storage into the dense * form - QAK) */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + if (vol_is_native) { + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + } /* Add second "big" attribute, which should leave storage in dense form */ @@ -3864,10 +4041,12 @@ test_attr_big(hid_t fcpl, hid_t fapl) * message heap instead of forcing the attribute storage into the dense * form - QAK) */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + if (vol_is_native) { + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + } /* Delete second "small" attribute, attributes should still be stored densely */ @@ -3877,11 +4056,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + } /* Delete second "big" attribute, attributes should still be stored densely */ @@ -3891,11 +4072,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, (nshared_indices ? false : true), "H5O__is_attr_dense_test"); + } /* Delete first "big" attribute, attributes should _not_ be stored densely */ @@ -3905,11 +4088,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Delete first "small" attribute, should be no attributes now */ @@ -3919,11 +4104,13 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + } } /* end if */ - else { + else if (vol_is_native) { /* Shouldn't be able to create "big" attributes with older version of format */ VERIFY(attr, FAIL, "H5Acreate2"); @@ -3956,7 +4143,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -3981,11 +4168,12 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned value; /* Attribute value */ htri_t cmp; /* Results of comparison */ - hsize_t storage_size; /* Size of storage for attribute */ + hsize_t storage_size = 0; /* Size of storage for attribute */ H5A_info_t ainfo; /* Attribute info */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing Attributes with 'null' dataspace\n")); @@ -3994,14 +4182,19 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -4046,14 +4239,19 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) ret = H5Sclose(attr_sid); CHECK(ret, FAIL, "H5Sclose"); - /* Check the storage size for the attribute */ - storage_size = H5Aget_storage_size(attr); - VERIFY(storage_size, 0, "H5Aget_storage_size"); + if (vol_is_native) { + /* Check the storage size for the attribute */ + storage_size = H5Aget_storage_size(attr); + VERIFY(storage_size, 0, "H5Aget_storage_size"); + } /* Get the attribute info */ ret = H5Aget_info(attr, &ainfo); CHECK(ret, FAIL, "H5Aget_info"); - VERIFY(ainfo.data_size, storage_size, "H5Aget_info"); + + if (vol_is_native) { + VERIFY(ainfo.data_size, storage_size, "H5Aget_info"); + } /* Close attribute */ ret = H5Aclose(attr); @@ -4120,14 +4318,19 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) ret = H5Sclose(attr_sid); CHECK(ret, FAIL, "H5Sclose"); - /* Check the storage size for the attribute */ - storage_size = H5Aget_storage_size(attr); - VERIFY(storage_size, 0, "H5Aget_storage_size"); + if (vol_is_native) { + /* Check the storage size for the attribute */ + storage_size = H5Aget_storage_size(attr); + VERIFY(storage_size, 0, "H5Aget_storage_size"); + } /* Get the attribute info */ ret = H5Aget_info(attr, &ainfo); CHECK(ret, FAIL, "H5Aget_info"); - VERIFY(ainfo.data_size, storage_size, "H5Aget_info"); + + if (vol_is_native) { + VERIFY(ainfo.data_size, storage_size, "H5Aget_info"); + } /* Close attribute */ ret = H5Aclose(attr); @@ -4167,7 +4370,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) ret = H5Sclose(null_sid); CHECK(ret, FAIL, "H5Sclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -4424,7 +4627,8 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) unsigned crt_order_flags; /* Creation order flags */ htri_t is_empty; /* Are there any attributes? */ htri_t is_dense; /* Are attributes stored densely? */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Code for Attributes with Creation Order Info\n")); @@ -4433,6 +4637,9 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Create dataset creation property list */ if (dcpl_g == H5P_DEFAULT) { dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -4478,11 +4685,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Close Dataset */ ret = H5Dclose(dataset); @@ -4504,11 +4713,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dopen2"); - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Retrieve dataset creation property list for group */ dcpl = H5Dget_create_plist(dataset); @@ -4555,7 +4766,8 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compact Storage of Attributes with Creation Order Info\n")); @@ -4564,6 +4776,9 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Create dataset creation property list */ if (dcpl_g == H5P_DEFAULT) { dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -4613,11 +4828,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Create several attributes, but keep storage in compact form */ for (u = 0; u < max_compact; u++) { @@ -4634,14 +4851,16 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } } /* end for */ } /* end for */ @@ -4696,14 +4915,16 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Loop through attributes, checking their creation order values */ /* (the name index is used, but the creation order value is in the same order) */ @@ -4759,7 +4980,8 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Storage of Attributes with Creation Order Info\n")); @@ -4768,6 +4990,9 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Create dataset creation property list */ if (dcpl_g == H5P_DEFAULT) { dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -4817,11 +5042,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Create several attributes, but keep storage in compact form */ for (u = 0; u < max_compact; u++) { @@ -4838,14 +5065,16 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } } /* end for */ /* Create another attribute, to push into dense storage */ @@ -4861,19 +5090,21 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } } /* end for */ /* Close Datasets */ @@ -4927,14 +5158,16 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Loop through attributes, checking their creation order values */ /* (the name index is used, but the creation order value is in the same order) */ @@ -5096,7 +5329,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storage Transitions of Attributes with Creation Order Info\n")); @@ -5105,6 +5339,9 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Create dataset creation property list */ if (dcpl_g == H5P_DEFAULT) { dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -5158,11 +5395,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } } /* end for */ /* Close Datasets */ @@ -5227,14 +5466,16 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (u + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } } /* end for */ /* Create another attribute, to push into dense storage */ @@ -5250,30 +5491,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - - /* Delete several attributes from object, until attribute storage resumes compact form */ - for (u = max_compact; u >= min_dense; u--) { - snprintf(attrname, sizeof(attrname), "attr %02u", u); - ret = H5Adelete(my_dataset, attrname); - CHECK(ret, FAIL, "H5Adelete"); - + if (vol_is_native) { /* Verify state of object */ ret = H5O__num_attrs_test(my_dataset, &nattrs); CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, u, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); is_empty = H5O__is_attr_empty_test(my_dataset); VERIFY(is_empty, false, "H5O__is_attr_empty_test"); is_dense = H5O__is_attr_dense_test(my_dataset); @@ -5283,6 +5505,29 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); CHECK(ret, FAIL, "H5O__attr_dense_info_test"); VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } + + /* Delete several attributes from object, until attribute storage resumes compact form */ + for (u = max_compact; u >= min_dense; u--) { + snprintf(attrname, sizeof(attrname), "attr %02u", u); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); + + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, u, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ @@ -5290,14 +5535,16 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Re-add attributes to get back into dense form */ for (u = (min_dense - 1); u < (max_compact + 1); u++) { @@ -5315,19 +5562,21 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } } /* end for */ /* Close Datasets */ @@ -5373,30 +5622,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - - /* Delete several attributes from object, until attribute storage resumes compact form */ - for (u = max_compact; u >= min_dense; u--) { - snprintf(attrname, sizeof(attrname), "attr %02u", u); - ret = H5Adelete(my_dataset, attrname); - CHECK(ret, FAIL, "H5Adelete"); - - /* Verify state of object */ + if (vol_is_native) { + /* Check on dataset's attribute storage status */ ret = H5O__num_attrs_test(my_dataset, &nattrs); CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, u, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); is_empty = H5O__is_attr_empty_test(my_dataset); VERIFY(is_empty, false, "H5O__is_attr_empty_test"); is_dense = H5O__is_attr_dense_test(my_dataset); @@ -5406,6 +5636,29 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); CHECK(ret, FAIL, "H5O__attr_dense_info_test"); VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } + + /* Delete several attributes from object, until attribute storage resumes compact form */ + for (u = max_compact; u >= min_dense; u--) { + snprintf(attrname, sizeof(attrname), "attr %02u", u); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); + + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, u, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ @@ -5413,14 +5666,16 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Re-add attributes to get back into dense form */ for (u = (min_dense - 1); u < (max_compact + 1); u++) { @@ -5438,19 +5693,21 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } /* Delete all attributes */ for (u = max_compact; u > 0; u--) { @@ -5506,7 +5763,8 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Object w/Dense Attribute Storage and Creation Order Info\n")); @@ -5538,7 +5796,10 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) for (reopen_file = false; reopen_file <= true; reopen_file++) { /* Create test file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); - CHECK(fid, FAIL, "H5Fopen"); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); /* Create datasets */ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); @@ -5567,11 +5828,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Create attributes, until attribute storage is in dense form */ for (u = 0; u < max_compact * 2; u++) { @@ -5589,19 +5852,21 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + } } /* end for */ /* Close Datasets */ @@ -5706,22 +5971,32 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, bool use_i * index. */ if (use_index) { + H5_iter_order_t order; + bool vol_is_native; + + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, obj_id, &vol_is_native), FAIL, "h5_using_native_vol"); + + if (vol_is_native) + order = H5_ITER_NATIVE; + else + order = H5_ITER_INC; + /* Verify the information for first attribute, in native creation order */ memset(&ainfo, 0, sizeof(ainfo)); - ret = H5Aget_info_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &ainfo, - H5P_DEFAULT); + ret = H5Aget_info_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)0, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_idx"); VERIFY(ainfo.corder, 0, "H5Aget_info_by_idx"); /* Verify the information for new attribute, in native creation order */ memset(&ainfo, 0, sizeof(ainfo)); - ret = H5Aget_info_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &ainfo, H5P_DEFAULT); + ret = H5Aget_info_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, order, n, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_idx"); VERIFY(ainfo.corder, n, "H5Aget_info_by_idx"); /* Verify the name for new link, in increasing native order */ memset(tmpname, 0, (size_t)NAME_BUF_SIZE); - ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, + ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, order, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); if (strcmp(attrname, tmpname) != 0) @@ -5827,7 +6102,8 @@ test_attr_info_by_idx(bool new_format, hid_t fcpl, hid_t fapl) char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -5859,6 +6135,9 @@ test_attr_info_by_idx(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -5893,11 +6172,13 @@ test_attr_info_by_idx(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for query on non-existent attribute */ H5E_BEGIN_TRY @@ -5935,14 +6216,16 @@ test_attr_info_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for out of bound offset queries */ H5E_BEGIN_TRY @@ -5982,32 +6265,36 @@ test_attr_info_by_idx(bool new_format, hid_t fcpl, hid_t fapl) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Verify state of object */ - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + } /* Verify information for new attribute */ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } /* end if */ + } /* Check for out of bound offset queries */ H5E_BEGIN_TRY @@ -6311,10 +6598,16 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ MESSAGE(5, ("Testing Deleting Attribute By Index\n")); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) { + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); @@ -6381,6 +6674,9 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -6415,11 +6711,13 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for deleting non-existent attribute */ H5E_BEGIN_TRY @@ -6450,14 +6748,16 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for out of bound deletions */ H5E_BEGIN_TRY @@ -6522,9 +6822,11 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); CHECK(ret, FAIL, "H5Adelete_by_idx"); - /* Verify state of attribute storage (empty) */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + if (vol_is_native) { + /* Verify state of attribute storage (empty) */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + } } /* end for */ /* Work on all the datasets */ @@ -6563,33 +6865,35 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - } /* end if */ + } /* Verify information for new attribute */ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } /* end if */ + } /* Check for out of bound deletion */ H5E_BEGIN_TRY @@ -6654,9 +6958,11 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); CHECK(ret, FAIL, "H5Adelete_by_idx"); - /* Verify state of attribute storage (empty) */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + if (vol_is_native) { + /* Verify state of attribute storage (empty) */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + } /* Check for deletion on empty attribute storage again */ H5E_BEGIN_TRY @@ -6705,7 +7011,7 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); } /* end if */ @@ -6825,9 +7131,11 @@ test_attr_delete_by_idx(bool new_format, hid_t fcpl, hid_t fapl) ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); CHECK(ret, FAIL, "H5Adelete_by_idx"); - /* Verify state of attribute storage (empty) */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + if (vol_is_native) { + /* Verify state of attribute storage (empty) */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + } /* Check for deletion on empty attribute storage again */ H5E_BEGIN_TRY @@ -6978,11 +7286,22 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx unsigned oskip; /* # of attributes to skip on object, with H5Aiterate1 */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ITERATE)) { + SKIPPED(); + printf(" API functions for iterate aren't " + "supported with this connector\n"); + return 1; + } + + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, obj_id, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Iterate over attributes on object */ iter_info->nskipped = (unsigned)(skip = 0); iter_info->order = order; @@ -7029,20 +7348,22 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx VERIFY(iter_info->visited[v], true, "H5Aiterate_by_name"); #ifndef H5_NO_DEPRECATED_SYMBOLS - /* Iterate over attributes on object, with H5Aiterate1 */ - iter_info->nskipped = oskip = 0; - iter_info->order = order; - iter_info->stop = -1; - iter_info->ncalled = 0; - iter_info->curr = order != H5_ITER_DEC ? 0 : (max_attrs - 1); - memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); - ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); - CHECK(ret, FAIL, "H5Aiterate1"); - - /* Verify that we visited all the attributes */ - VERIFY(skip, max_attrs, "H5Aiterate1"); - for (v = 0; v < max_attrs; v++) - VERIFY(iter_info->visited[v], true, "H5Aiterate1"); + if (vol_is_native) { + /* Iterate over attributes on object, with H5Aiterate1 */ + iter_info->nskipped = oskip = 0; + iter_info->order = order; + iter_info->stop = -1; + iter_info->ncalled = 0; + iter_info->curr = order != H5_ITER_DEC ? 0 : (max_attrs - 1); + memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); + ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); + CHECK(ret, FAIL, "H5Aiterate1"); + + /* Verify that we visited all the attributes */ + VERIFY(skip, max_attrs, "H5Aiterate1"); + for (v = 0; v < max_attrs; v++) + VERIFY(iter_info->visited[v], true, "H5Aiterate1"); + } #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Skip over some attributes on object */ @@ -7139,36 +7460,38 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx } /* end else */ #ifndef H5_NO_DEPRECATED_SYMBOLS - /* Skip over some attributes on object, with H5Aiterate1 */ - iter_info->nskipped = oskip = max_attrs / 2; - iter_info->order = order; - iter_info->stop = -1; - iter_info->ncalled = 0; - iter_info->curr = order != H5_ITER_DEC ? (unsigned)oskip : ((max_attrs - 1) - oskip); - memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); - ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); - CHECK(ret, FAIL, "H5Aiterate1"); - - /* Verify that we visited all the links */ - VERIFY(oskip, max_attrs, "H5Aiterate1"); - if (order == H5_ITER_INC) { - for (v = 0; v < (max_attrs / 2); v++) - VERIFY(iter_info->visited[v + (max_attrs / 2)], true, "H5Aiterate1"); - } /* end if */ - else if (order == H5_ITER_DEC) { - for (v = 0; v < (max_attrs / 2); v++) - VERIFY(iter_info->visited[v], true, "H5Aiterate1"); - } /* end if */ - else { - unsigned nvisit = 0; /* # of links visited */ + if (vol_is_native) { + /* Skip over some attributes on object, with H5Aiterate1 */ + iter_info->nskipped = oskip = max_attrs / 2; + iter_info->order = order; + iter_info->stop = -1; + iter_info->ncalled = 0; + iter_info->curr = order != H5_ITER_DEC ? (unsigned)oskip : ((max_attrs - 1) - oskip); + memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); + ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); + CHECK(ret, FAIL, "H5Aiterate1"); + + /* Verify that we visited all the links */ + VERIFY(oskip, max_attrs, "H5Aiterate1"); + if (order == H5_ITER_INC) { + for (v = 0; v < (max_attrs / 2); v++) + VERIFY(iter_info->visited[v + (max_attrs / 2)], true, "H5Aiterate1"); + } /* end if */ + else if (order == H5_ITER_DEC) { + for (v = 0; v < (max_attrs / 2); v++) + VERIFY(iter_info->visited[v], true, "H5Aiterate1"); + } /* end if */ + else { + unsigned nvisit = 0; /* # of links visited */ - assert(order == H5_ITER_NATIVE); - for (v = 0; v < max_attrs; v++) - if (iter_info->visited[v] == true) - nvisit++; + assert(order == H5_ITER_NATIVE); + for (v = 0; v < max_attrs; v++) + if (iter_info->visited[v] == true) + nvisit++; - VERIFY(nvisit, max_attrs, "H5Aiterate1"); - } /* end else */ + VERIFY(nvisit, max_attrs, "H5Aiterate1"); + } /* end else */ + } #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Iterate over attributes on object, stopping in the middle */ @@ -7208,17 +7531,19 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx VERIFY(iter_info->ncalled, 3, "H5Aiterate_by_name"); #ifndef H5_NO_DEPRECATED_SYMBOLS - /* Iterate over attributes on object, stopping in the middle, with H5Aiterate1() */ - iter_info->nskipped = oskip = 0; - iter_info->order = order; - iter_info->stop = 3; - iter_info->ncalled = 0; - iter_info->curr = order != H5_ITER_DEC ? 0 : (max_attrs - 1); - memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); - ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); - CHECK(ret, FAIL, "H5Aiterate1"); - VERIFY(ret, CORDER_ITER_STOP, "H5Aiterate1"); - VERIFY(iter_info->ncalled, 3, "H5Aiterate1"); + if (vol_is_native) { + /* Iterate over attributes on object, stopping in the middle, with H5Aiterate1() */ + iter_info->nskipped = oskip = 0; + iter_info->order = order; + iter_info->stop = 3; + iter_info->ncalled = 0; + iter_info->curr = order != H5_ITER_DEC ? 0 : (max_attrs - 1); + memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit); + ret = H5Aiterate1(obj_id, &oskip, attr_iterate1_cb, iter_info); + CHECK(ret, FAIL, "H5Aiterate1"); + VERIFY(ret, CORDER_ITER_STOP, "H5Aiterate1"); + VERIFY(iter_info->ncalled, 3, "H5Aiterate1"); + } #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Check for iteration routine indicating failure */ @@ -7287,7 +7612,11 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ + + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) + return; /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7361,6 +7690,9 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -7398,11 +7730,13 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for iterating over object with no attributes (should be OK) */ ret = H5Aiterate2(my_dataset, idx_type, order, NULL, attr_iterate2_cb, NULL); @@ -7437,45 +7771,49 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - - /* Check for out of bound iteration */ - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); - } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate2"); - - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate_by_name"); - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, - NULL, H5P_DEFAULT); + if (vol_cap_flags_g & H5VL_CAP_FLAG_ITERATE) { + /* Check for out of bound iteration */ + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate2"); + + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate_by_name"); + + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate_by_name"); + + /* Test iteration over attributes stored compactly */ + ret = attr_iterate_check(fid, dsetname, my_dataset, idx_type, order, u, &iter_info); + CHECK(ret, FAIL, "attr_iterate_check"); } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate_by_name"); - - /* Test iteration over attributes stored compactly */ - ret = attr_iterate_check(fid, dsetname, my_dataset, idx_type, order, u, &iter_info); - CHECK(ret, FAIL, "attr_iterate_check"); } /* end for */ /* Work on all the datasets */ @@ -7517,7 +7855,7 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); } /* end if */ @@ -7527,55 +7865,59 @@ test_attr_iterate2(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ - - /* Check for out of bound iteration */ - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); - } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate2"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate_by_name"); - idx = u; - H5E_BEGIN_TRY - { - ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, - NULL, H5P_DEFAULT); + if (vol_cap_flags_g & H5VL_CAP_FLAG_ITERATE) { + /* Check for out of bound iteration */ + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate2"); + + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate_by_name"); + + idx = u; + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Aiterate_by_name"); + + /* Test iteration over attributes stored densely */ + ret = attr_iterate_check(fid, dsetname, my_dataset, idx_type, order, u, &iter_info); + CHECK(ret, FAIL, "attr_iterate_check"); } - H5E_END_TRY - VERIFY(ret, FAIL, "H5Aiterate_by_name"); - - /* Test iteration over attributes stored densely */ - ret = attr_iterate_check(fid, dsetname, my_dataset, idx_type, order, u, &iter_info); - CHECK(ret, FAIL, "attr_iterate_check"); - } /* end for */ + } /* Close Datasets */ ret = H5Dclose(dset1); @@ -7687,8 +8029,12 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ + + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) + return; /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7756,6 +8102,9 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -7790,11 +8139,13 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for opening an attribute on an object with no attributes */ H5E_BEGIN_TRY @@ -7826,14 +8177,16 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for out of bound opening an attribute on an object */ H5E_BEGIN_TRY @@ -7885,7 +8238,7 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); } /* end if */ @@ -7895,23 +8248,25 @@ test_attr_open_by_idx(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } /* end if */ + } /* Check for out of bound opening an attribute on an object */ H5E_BEGIN_TRY @@ -8057,8 +8412,9 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -8090,6 +8446,9 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -8127,11 +8486,13 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for opening a non-existent attribute on an object with no attributes */ H5E_BEGIN_TRY @@ -8175,14 +8536,16 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Check for opening a non-existent attribute on an object with compact attribute storage */ H5E_BEGIN_TRY @@ -8249,7 +8612,7 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); } /* end if */ @@ -8259,23 +8622,25 @@ test_attr_open_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } /* end if */ + } /* Check for opening a non-existent attribute on an object with dense attribute storage */ H5E_BEGIN_TRY @@ -8353,7 +8718,8 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -8385,6 +8751,9 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Set attribute creation order tracking & indexing for object */ if (new_format == true) { ret = H5Pset_attr_creation_order( @@ -8422,11 +8791,13 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) assert(0 && "Too many datasets!"); } /* end switch */ - /* Check on dataset's attribute storage status */ - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, true, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, true, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Create attributes, up to limit of compact form */ for (u = 0; u < max_compact; u++) { @@ -8449,14 +8820,16 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, max_compact, "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Test opening attributes stored compactly */ ret = attr_open_check(fid, dsetname, my_dataset, u); @@ -8502,7 +8875,7 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify state of object */ - if (u >= max_compact) { + if (vol_is_native && (u >= max_compact)) { is_dense = H5O__is_attr_dense_test(my_dataset); VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); } /* end if */ @@ -8512,23 +8885,25 @@ test_attr_create_by_name(bool new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "attr_info_by_idx_check"); } /* end for */ - /* Verify state of object */ - ret = H5O__num_attrs_test(my_dataset, &nattrs); - CHECK(ret, FAIL, "H5O__num_attrs_test"); - VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); - is_empty = H5O__is_attr_empty_test(my_dataset); - VERIFY(is_empty, false, "H5O__is_attr_empty_test"); - is_dense = H5O__is_attr_dense_test(my_dataset); - VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Verify state of object */ + ret = H5O__num_attrs_test(my_dataset, &nattrs); + CHECK(ret, FAIL, "H5O__num_attrs_test"); + VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test"); + is_empty = H5O__is_attr_empty_test(my_dataset); + VERIFY(is_empty, false, "H5O__is_attr_empty_test"); + is_dense = H5O__is_attr_dense_test(my_dataset); + VERIFY(is_dense, (new_format ? true : false), "H5O__is_attr_dense_test"); - if (new_format) { - /* Retrieve & verify # of records in the name & creation order indices */ - ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); - CHECK(ret, FAIL, "H5O__attr_dense_info_test"); - if (use_index) - VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); - VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); - } /* end if */ + if (new_format) { + /* Retrieve & verify # of records in the name & creation order indices */ + ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count); + CHECK(ret, FAIL, "H5O__attr_dense_info_test"); + if (use_index) + VERIFY(name_count, corder_count, "H5O__attr_dense_info_test"); + VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test"); + } /* end if */ + } /* Test opening attributes stored compactly */ ret = attr_open_check(fid, dsetname, my_dataset, u); @@ -8585,9 +8960,10 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8644,6 +9020,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, my_fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close FCPL copy */ ret = H5Pclose(my_fcpl); CHECK(ret, FAIL, "H5Pclose"); @@ -8652,10 +9031,12 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -8684,7 +9065,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { /* Datasets' datatypes can be shared */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); @@ -8704,11 +9085,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on datasets' attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - is_dense = H5O__is_attr_dense_test(dataset2); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on datasets' attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + is_dense = H5O__is_attr_dense_test(dataset2); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes to each dataset, until after converting to dense storage */ for (u = 0; u < max_compact * 2; u++) { @@ -8721,9 +9104,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -8735,36 +9120,42 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Alternate between creating "small" & "big" attributes */ if (u % 2) { @@ -8772,9 +9163,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -8786,36 +9179,42 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset2); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset2); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } } /* end for */ /* Close attribute's datatype */ @@ -8829,7 +9228,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Dclose"); /* Check on shared message status now */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { if (test_shared == 1) { /* Check on datatype storage status */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); @@ -8841,7 +9240,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test"); - } /* end if */ + } /* Unlink datasets with attributes */ ret = H5Ldelete(fid, DSET1_NAME, H5P_DEFAULT); @@ -8855,28 +9254,30 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Ldelete"); } /* end if */ - /* Check on attribute storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - - if (test_shared != 0) { - /* Check on datatype storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + if (vol_is_native) { + /* Check on attribute storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - /* Check on dataspace storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - } /* end if */ + if (test_shared != 0) { + /* Check on datatype storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + + /* Check on dataspace storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + } /* end if */ + } /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -8922,9 +9323,10 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8981,6 +9383,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, my_fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close FCPL copy */ ret = H5Pclose(my_fcpl); CHECK(ret, FAIL, "H5Pclose"); @@ -8989,10 +9394,12 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -9021,7 +9428,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { /* Datasets' datatypes can be shared */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); @@ -9041,11 +9448,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on datasets' attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - is_dense = H5O__is_attr_dense_test(dataset2); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on datasets' attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + is_dense = H5O__is_attr_dense_test(dataset2); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes to each dataset, until after converting to dense storage */ for (u = 0; u < max_compact * 2; u++) { @@ -9058,9 +9467,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9072,36 +9483,42 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Alternate between creating "small" & "big" attributes */ if (u % 2) { @@ -9109,9 +9526,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9123,36 +9542,42 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset2); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset2); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Create new attribute name */ snprintf(attrname2, sizeof(attrname2), "new attr %02u", u); @@ -9167,21 +9592,23 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset2, attrname2, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -9191,21 +9618,23 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -9221,21 +9650,23 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset2, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -9245,21 +9676,23 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -9277,7 +9710,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Dclose"); /* Check on shared message status now */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { if (test_shared == 1) { /* Check on datatype storage status */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); @@ -9303,28 +9736,30 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Ldelete"); } /* end if */ - /* Check on attribute storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - - if (test_shared != 0) { - /* Check on datatype storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + if (vol_is_native) { + /* Check on attribute storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - /* Check on dataspace storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - } /* end if */ + if (test_shared != 0) { + /* Check on datatype storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + + /* Check on dataspace storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + } /* end if */ + } /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -9369,9 +9804,10 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -9428,6 +9864,9 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, my_fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close FCPL copy */ ret = H5Pclose(my_fcpl); CHECK(ret, FAIL, "H5Pclose"); @@ -9436,10 +9875,12 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -9468,7 +9909,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { /* Datasets' datatypes can be shared */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); @@ -9488,11 +9929,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on datasets' attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - is_dense = H5O__is_attr_dense_test(dataset2); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on datasets' attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + is_dense = H5O__is_attr_dense_test(dataset2); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes to each dataset, until after converting to dense storage */ for (u = 0; u < max_compact * 2; u++) { @@ -9505,9 +9948,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9519,36 +9964,42 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Alternate between creating "small" & "big" attributes */ if (u % 2) { @@ -9556,9 +10007,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9570,36 +10023,42 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset2); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset2); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } } /* end for */ /* Delete attributes from second dataset */ @@ -9617,21 +10076,23 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -9649,7 +10110,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Dclose"); /* Check on shared message status now */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { if (test_shared == 1) { /* Check on datatype storage status */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); @@ -9675,28 +10136,30 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Ldelete"); } /* end if */ - /* Check on attribute storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - - if (test_shared != 0) { - /* Check on datatype storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + if (vol_is_native) { + /* Check on attribute storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - /* Check on dataspace storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - } /* end if */ + if (test_shared != 0) { + /* Check on datatype storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + + /* Check on dataspace storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + } /* end if */ + } /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -9741,9 +10204,10 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ - h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t empty_filesize = 0; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + bool vol_is_native; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n")); @@ -9800,6 +10264,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, my_fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + /* Close FCPL copy */ ret = H5Pclose(my_fcpl); CHECK(ret, FAIL, "H5Pclose"); @@ -9808,10 +10275,12 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME, fapl); - if (empty_filesize < 0) - TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + if (vol_is_native) { + /* Get size of file */ + empty_filesize = h5_get_file_size(FILENAME, fapl); + if (empty_filesize < 0) + TestErrPrintf("Line %d: file size wrong!\n", __LINE__); + } /* Re-open file */ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -9840,7 +10309,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ - if (test_shared != 0) { + if (vol_is_native && (test_shared != 0)) { /* Datasets' datatypes can be shared */ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); @@ -9860,11 +10329,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Check on datasets' attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - is_dense = H5O__is_attr_dense_test(dataset2); - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on datasets' attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + is_dense = H5O__is_attr_dense_test(dataset2); + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + } /* Add attributes to each dataset, until after converting to dense storage */ for (u = 0; u < max_compact * 2; u++) { @@ -9877,9 +10348,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9891,36 +10364,42 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* ChecFk that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* ChecFk that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Alternate between creating "small" & "big" attributes */ if (u % 2) { @@ -9928,9 +10407,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* Write data into the attribute */ attr_value = u + 1; @@ -9942,36 +10423,42 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset2, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); + if (vol_is_native) { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* Write data into the attribute */ big_value[0] = u + 1; ret = H5Awrite(attr, attr_tid, big_value); CHECK(ret, FAIL, "H5Awrite"); - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + if (vol_is_native) { + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); + } } /* end else */ /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - /* Check on dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset2); - if (u < max_compact) - VERIFY(is_dense, false, "H5O__is_attr_dense_test"); - else - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset2); + if (u < max_compact) + VERIFY(is_dense, false, "H5O__is_attr_dense_test"); + else + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } } /* end for */ /* Close attribute's datatype */ @@ -9986,9 +10473,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) ret = H5Ldelete(fid, DSET2_NAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Check on first dataset's attribute storage status */ - is_dense = H5O__is_attr_dense_test(dataset); - VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + if (vol_is_native) { + /* Check on first dataset's attribute storage status */ + is_dense = H5O__is_attr_dense_test(dataset); + VERIFY(is_dense, true, "H5O__is_attr_dense_test"); + } /* Check ref count on attributes of first dataset */ for (u = 0; u < max_compact * 2; u++) { @@ -9999,21 +10488,23 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); - if (u % 2) { - /* Check that attribute is not shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, false, "H5A__is_shared_test"); - } /* end if */ - else { - /* Check that attribute is shared */ - is_shared = H5A__is_shared_test(attr); - VERIFY(is_shared, true, "H5A__is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A__get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A__get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); - } /* end else */ + if (vol_is_native) { + if (u % 2) { + /* Check that attribute is not shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, false, "H5A__is_shared_test"); + } /* end if */ + else { + /* Check that attribute is shared */ + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, true, "H5A__is_shared_test"); + + /* Check refcount for attribute */ + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); + } /* end else */ + } /* Close attribute */ ret = H5Aclose(attr); @@ -10034,28 +10525,30 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Ldelete"); } /* end if */ - /* Check on attribute storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - - if (test_shared != 0) { - /* Check on datatype storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + if (vol_is_native) { + /* Check on attribute storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - /* Check on dataspace storage status */ - ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); - CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); - VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); - } /* end if */ + if (test_shared != 0) { + /* Check on datatype storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + + /* Check on dataspace storage status */ + ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); + CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test"); + VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test"); + } /* end if */ + } /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - if (h5_using_default_driver(NULL)) { + if (vol_is_native && h5_using_default_driver(NULL)) { /* Check size of file */ filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); @@ -10825,16 +11318,26 @@ test_attr_bug7(hid_t fcpl, hid_t fapl) hsize_t dims_s = 140; /* Small attribute dimensions */ hsize_t dims_l = 65480; /* Large attribute dimensions */ H5A_info_t ainfo; /* Attribute info */ - herr_t ret; /* Generic return status */ + bool vol_is_native; + herr_t ret; /* Generic return status */ /* Output message about test being performed */ MESSAGE(5, ("Testing adding and deleting large attributes\n")); + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create committed datatype to operate on. Use a committed datatype so that * there is nothing after the object header and the first chunk can expand and * contract as necessary. */ - fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); - CHECK(fid, FAIL, "H5Fcreate"); tid = H5Tcopy(H5T_STD_I32LE); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tcommit2(fid, TYPE1_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -11337,7 +11840,8 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) hsize_t dim2[2] = {DIM0, DIM1}; /* Dimension sizes */ int i, j; /* Local index variables */ double *data = NULL; /* Pointer to the data buffer */ - herr_t ret; /* Generic return status */ + bool vol_is_native; + herr_t ret; /* Generic return status */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting the last large attribute stored densely\n")); @@ -11346,6 +11850,14 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(fapl, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create the group */ gid = H5Gcreate2(fid, GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid, FAIL, "H5Gcreate"); |