Incorporate minimized dset ohdr tests into extant suite.

This commit is contained in:
Jacob Smith 2018-11-19 14:08:31 -06:00
parent f5114fcddb
commit 1fed1a7be7
4 changed files with 1484 additions and 1339 deletions

View File

@ -13079,14 +13079,14 @@ test_object_header_minimization_dcpl(void)
/* TESTS */
/*********/
/* TEST default value (not set explicitly)
/* default value (not set explicitly)
*/
if (FAIL == H5Pget_dset_no_attrs_hint(dcpl_id, &minimize))
FAIL_PUTS_ERROR("unable to get minimize value\n");
if (FALSE != minimize)
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
/* TEST FALSE-set value
/* FALSE-set value
*/
if (FAIL == H5Pset_dset_no_attrs_hint(dcpl_id, FALSE))
FAIL_PUTS_ERROR("unable to set minimize value to FALSE\n");
@ -13095,7 +13095,7 @@ test_object_header_minimization_dcpl(void)
if (FALSE != minimize)
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
/* TEST TRUE-set value
/* TRUE-set value
*/
if (FAIL == H5Pset_dset_no_attrs_hint(dcpl_id, TRUE))
FAIL_PUTS_ERROR("unable to set minimize value to TRUE\n");
@ -13104,7 +13104,7 @@ test_object_header_minimization_dcpl(void)
if (TRUE != minimize)
FAIL_PUTS_ERROR("Expected TRUE default but was not!\n");
/* TEST error cases
/* error cases
*/
H5E_BEGIN_TRY {
if (SUCCEED == H5Pget_dset_no_attrs_hint(-1, &minimize))
@ -13163,6 +13163,7 @@ main(void)
hid_t fcpl = -1, fcpl2 = -1;
unsigned new_format;
unsigned paged;
unsigned minimized_ohdr;
int mdc_nelmts;
size_t rdcc_nelmts;
size_t rdcc_nbytes;
@ -13213,10 +13214,12 @@ main(void)
/* Test with paged aggregation enabled or not */
for(paged = FALSE; paged <= TRUE; paged++) {
/* Temporary: skip testing for multi/split drivers:
fail file create when persisting free-space or using paged aggregation strategy */
if(!contig_addr_vfd && paged)
continue;
/* Temporary: skip testing for multi/split drivers:
fail file create when persisting free-space or using paged aggregation strategy */
if(!contig_addr_vfd && paged)
continue;
for (minimized_ohdr = FALSE; minimized_ohdr <= TRUE; minimized_ohdr++) {
/* Test with old & new format groups */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
@ -13248,6 +13251,12 @@ main(void)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0)
goto error;
if (TRUE == minimized_ohdr) {
if (0 > H5Fset_dset_no_attrs_hint(file, TRUE))
goto error;
puts("(minimized dataset object headers with file setting)");
}
/* Cause the library to emit initial messages */
if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
@ -13325,6 +13334,7 @@ main(void)
if(H5Fclose(file) < 0)
goto error;
} /* end for new_format */
} /* for minimized dset object headers */
} /* end for paged */
/* Close property lists */

View File

@ -315,6 +315,8 @@ typedef struct {
const obj_visit_t *info; /* Pointer to the object visit structure to use */
} ovisit_ud_t;
static hid_t dcpl_g; /* for [un]minimized dataset object headers */
/*-------------------------------------------------------------------------
@ -377,7 +379,7 @@ mklinks(hid_t fapl, hbool_t new_format)
if(H5Gclose(grp) < 0) TEST_ERROR
/* Create a dataset */
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(d1) < 0) TEST_ERROR
/* Create a hard link */
@ -451,8 +453,8 @@ new_links(hid_t fapl, hbool_t new_format)
if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create datasets */
if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create links within a file. Both of source and destination use
* H5L_SAME_LOC. Both hard and soft links should fail. */
@ -1014,7 +1016,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if((space_id=H5Screate_simple(2 ,dims, NULL)) < 0) TEST_ERROR
/* Create a dataset using the default LCPL */
if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Check that its character encoding is the default */
@ -1043,7 +1045,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Create a dataset using the new LCPL */
if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Check that its character encoding is UTF-8 */
@ -3758,7 +3760,12 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
} else {
dcpl = H5Pcopy(dcpl_g);
}
if (0 > dcpl) TEST_ERROR;
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) TEST_ERROR;
/* create "Dataset" in group "A" of target file */
@ -6100,7 +6107,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
/* Test creating each kind of object */
if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close objects */
if(H5Gclose(gid) < 0) TEST_ERROR
@ -7298,7 +7305,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
if((space = H5Screate(H5S_SCALAR)) < 0)
TEST_ERROR
if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT)) < 0)
dcpl_g, H5P_DEFAULT)) < 0)
TEST_ERROR
if(H5Dclose(oid1) < 0)
TEST_ERROR
@ -7514,8 +7521,12 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
FAIL_STACK_ERROR
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
} else {
dcpl = H5Pcopy(dcpl_g);
}
if (0 > dcpl) FAIL_STACK_ERROR
if(H5Pset_chunk(dcpl, 2, chunks) < 0)
FAIL_STACK_ERROR
@ -9058,7 +9069,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
dims[0] = 2;
dims[1] = 2;
if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* Close group */
@ -9170,7 +9181,7 @@ linkinfo(hid_t fapl, hbool_t new_format)
if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@ -9335,13 +9346,13 @@ build_visit_file(hid_t fapl)
/* Create dataset in each group */
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Sclose(sid) < 0) TEST_ERROR
@ -14890,6 +14901,7 @@ main(void)
hid_t fapl, fapl2; /* File access property lists */
int nerrors = 0;
unsigned new_format; /* Whether to use the new format or not */
unsigned minimize_dset_oh;
unsigned efc; /* Whether to use the external file cache */
const char *env_h5_drvr; /* File Driver value from environment */
@ -14900,165 +14912,184 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
/* Copy the file access property list */
/* fapl2 uses "latest version bounds" */
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
/* Set the "use the latest version of the format" bounds for creating objects in the file */
if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR
/* Loop over using new group format */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
hid_t my_fapl;
for (minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
if (minimize_dset_oh) {
printf("\n-Testing with minimzed dataset object headers-\n");
dcpl_g = H5Pcreate(H5P_DATASET_CREATE);
if (0 > dcpl_g) TEST_ERROR
} else {
printf("\n-Testing with unminimzed dataset object headers-\n");
dcpl_g = H5P_DEFAULT;
}
/* Check for FAPL to use */
if(new_format)
my_fapl = fapl2;
else
my_fapl = fapl;
for(new_format = FALSE; new_format <= TRUE; new_format++) {
hid_t my_fapl;
/* General tests... (on both old & new format groups */
nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
/* Check for FAPL to use */
if(new_format) {
my_fapl = fapl2;
printf("\n--Testing with 'new format'--\n");
} else {
my_fapl = fapl;
printf("\n--Testing with 'old format'--\n");
}
/* Test new H5L link creation routine */
nerrors += test_lcpl(my_fapl, new_format);
nerrors += test_move(my_fapl, new_format);
nerrors += test_copy(my_fapl, new_format);
nerrors += test_move_preserves(my_fapl, new_format);
/* always enter tests without external cache */
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) TEST_ERROR
/* General tests... (on both old & new format groups */
nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
/* Test new H5L link creation routine */
nerrors += test_lcpl(my_fapl, new_format);
nerrors += test_move(my_fapl, new_format);
nerrors += test_copy(my_fapl, new_format);
nerrors += test_move_preserves(my_fapl, new_format);
#ifndef H5_NO_DEPRECATED_SYMBOLS
nerrors += test_deprec(my_fapl, new_format);
nerrors += test_deprec(my_fapl, new_format);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* tests for external link */
/* Test external file cache first, so it sees the default efc setting on
* the fapl */
nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0;
/* tests for external link */
/* Test external file cache first, so it sees the default efc setting on
* the fapl */
nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because it assumes that an
* intermediate file is not held open */
nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because it assumes that an
* intermediate file is not held open */
nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because the EFC cannot currently
* reopen a cached file with a different intent */
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because the EFC cannot currently
* reopen a cached file with a different intent */
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
/* Try external link tests both with and without the external file cache
*/
for(efc = FALSE; efc <= TRUE; efc++) {
if(efc) {
if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
TEST_ERROR
printf("\n---Testing with external file cache---\n");
} /* end if */
else {
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
TEST_ERROR
printf("\n---Testing without external file cache---\n");
} /* end else */
/* Try external link tests both with and without the external file cache
*/
for(efc = FALSE; efc <= TRUE; efc++) {
if(efc) {
if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
TEST_ERROR
printf("\n---Testing with external file cache---\n");
} /* end if */
else {
if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
TEST_ERROR
printf("\n---Testing without external file cache---\n");
} /* end else */
nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
#ifdef H5_HAVE_WINDOW_PATH
nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
#endif
nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
} /* end for */
nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
} /* with/without external file cache */
/* These tests assume that external links are a form of UD links,
* so assume that everything that passed for external links
* above has already been tested for UD links.
*/
if(new_format == TRUE) {
nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
} /* end if */
nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
/* These tests assume that external links are a form of UD links,
* so assume that everything that passed for external links
* above has already been tested for UD links.
*/
if(new_format == TRUE) {
nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
} /* end if */
nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
/* Misc. extra tests, useful for both new & old format files */
nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
/* Misc. extra tests, useful for both new & old format files */
nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
/* Keep this test last, it's testing files that are used above */
/* do not do this for files used by external link tests */
nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
} /* end for */
/* Keep this test last, it's testing files that are used above */
/* do not do this for files used by external link tests */
nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
} /* new/old format */
/* New group revision feature tests */
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
/* New group revision feature tests */
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
/* XXX: when creation order indexing is fully working, go back and add checks
* to these tests to make certain that the creation order values are
* correct.
*/
nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += object_info(fapl2) < 0 ? 1 : 0;
nerrors += group_info(fapl2) < 0 ? 1 : 0;
nerrors += timestamps(fapl2) < 0 ? 1 : 0;
nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
nerrors += object_info(fapl2) < 0 ? 1 : 0;
nerrors += group_info(fapl2) < 0 ? 1 : 0;
nerrors += timestamps(fapl2) < 0 ? 1 : 0;
/* Test new API calls on old-style groups */
nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += object_info_old(fapl) < 0 ? 1 : 0;
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
/* Test new API calls on old-style groups */
nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
nerrors += object_info_old(fapl) < 0 ? 1 : 0;
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
if (minimize_dset_oh) {
if (0 > H5Pclose(dcpl_g)) TEST_ERROR;
dcpl_g = -1;
}
} /* [un]minimized dataset object headers */
/* Close 2nd FAPL */
H5Pclose(fapl2);

View File

@ -157,6 +157,8 @@ typedef struct {
static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
void *op_data);
static hid_t dcpl_g = H5P_DEFAULT;
/****************************************************************
@ -196,7 +198,7 @@ test_attr_basic_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@ -516,7 +518,7 @@ test_attr_flush(hid_t fapl)
spc = H5Screate(H5S_SCALAR);
CHECK(spc, FAIL, "H5Screate");
set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(set, FAIL, "H5Dcreate2");
att = H5Acreate2(set, ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT);
@ -587,7 +589,7 @@ test_attr_plist(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@ -701,7 +703,7 @@ test_attr_compound_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
@ -937,7 +939,7 @@ test_attr_scalar_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@ -1078,7 +1080,7 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
@ -1456,7 +1458,7 @@ test_attr_iterate(hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a new dataset */
dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataspace */
@ -1681,7 +1683,7 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(space_id, FAIL, "H5Screate");
/* Create dataset */
dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dset_id, FAIL, "H5Dcreate2");
/* Check reference count on named datatype */
@ -1835,7 +1837,7 @@ test_attr_duplicate_ids(hid_t fapl)
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@ -2160,9 +2162,14 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -2291,9 +2298,14 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@ -2431,9 +2443,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@ -2610,9 +2627,14 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -2769,9 +2791,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -2897,9 +2924,14 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Change limits on compact/dense attribute storage */
max_compact = 0;
@ -3064,9 +3096,14 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -3594,9 +3631,14 @@ test_attr_big(hid_t fcpl, hid_t fapl)
big_sid = H5Screate_simple(ATTR6_RANK, dims, NULL);
CHECK(big_sid, FAIL, "H5Screate_simple");
/* Query the group creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* need DCPL to query the group creation properties */
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -3861,7 +3903,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
CHECK(null_sid, FAIL, "H5Screate");
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@ -4054,7 +4096,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@ -4290,8 +4332,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Get creation order indexing on object */
ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags);
@ -4413,8 +4460,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@ -4613,8 +4665,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@ -4948,8 +5005,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@ -5359,8 +5421,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@ -5702,8 +5769,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -5914,8 +5986,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -6857,8 +6934,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -7218,8 +7300,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -7565,8 +7652,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -7819,8 +7911,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@ -8120,8 +8217,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -8451,8 +8553,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -8897,8 +9004,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -9266,8 +9378,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
if (dcpl_g == H5P_DEFAULT) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
} else {
dcpl = H5Pcopy(dcpl_g);
CHECK(dcpl, FAIL, "H5Pcopy");
}
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@ -9858,7 +9975,7 @@ test_attr_bug3(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
/* Create attribute on datatype, using that datatype as its datatype */
@ -9993,7 +10110,7 @@ test_attr_bug4(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
/* Create attributes on group and dataset */
@ -10075,7 +10192,7 @@ test_attr_bug5(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did1, FAIL, "H5Dcreate2");
/* Create attribute on root group */
@ -10773,52 +10890,58 @@ test_attr(void)
{
hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */
unsigned new_format; /* Whether to use the new format or not */
unsigned use_shared; /* Whether to use shared attributes or not */
herr_t ret; /* Generic return value */
hid_t dcpl = -1;
unsigned new_format; /* Whether to use the new format or not */
unsigned use_shared; /* Whether to use shared attributes or not */
unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attributes\n"));
/* Create a default file access property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
/* Copy the file access property list */
fapl2 = H5Pcopy(fapl);
CHECK(fapl2, FAIL, "H5Pcopy");
/* Set the "use the latest version of the format" bounds for creating objects in the file */
ret = H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
/* Create a default file creation property list */
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
/* Copy the file creation property list */
/* files with fcpl2 make all attributes ( > 1 byte) shared
* (i.e. all of them :-) */
fcpl2 = H5Pcopy(fcpl);
CHECK(fcpl2, FAIL, "H5Pcopy");
/* Make attributes > 1 byte shared (i.e. all of them :-) */
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
ret = H5Pset_shared_mesg_index(fcpl2, (unsigned)0, H5O_SHMESG_ATTR_FLAG, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Loop over using new group format */
for(minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
if (minimize_dset_oh == 0) {
MESSAGE(7, ("testing with default dataset object headers\n"));
dcpl_g = H5P_DEFAULT;
} else {
MESSAGE(7, ("testing with minimzied dataset object headers\n"));
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
ret = H5Pset_dset_no_attrs_hint(dcpl, TRUE);
CHECK_I(ret, "H5Pset_dset_no_attrs_hint");
dcpl_g = dcpl;
}
for(new_format = FALSE; new_format <= TRUE; new_format++) {
hid_t my_fapl;
/* Set the FAPL for the type of format */
if(new_format) {
MESSAGE(7, ("testing with new file format\n"));
my_fapl = fapl2;
} /* end if */
else {
} else {
MESSAGE(7, ("testing with old file format\n"));
my_fapl = fapl;
} /* end else */
}
/* These next two tests use the same file information */
test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
@ -10848,22 +10971,48 @@ test_attr(void)
/* This next test uses its own file information */
test_attr_duplicate_ids(my_fapl);
/* Tests on "new format" attribute storage */
if(new_format == TRUE) {
/* Loop over using shared attributes */
for(use_shared = FALSE; use_shared <= TRUE; use_shared++) {
hid_t my_fcpl;
for(use_shared = FALSE; use_shared <= TRUE; use_shared++) {
hid_t my_fcpl;
/* Set the FCPL for shared or not */
if(use_shared) {
MESSAGE(7, ("testing with shared attributes\n"));
my_fcpl = fcpl2;
} /* end if */
else {
MESSAGE(7, ("testing without shared attributes\n"));
my_fcpl = fcpl;
} /* end else */
if(new_format == TRUE && use_shared) {
MESSAGE(7, ("testing with shared attributes\n"));
my_fcpl = fcpl2;
} else {
MESSAGE(7, ("testing without shared attributes\n"));
my_fcpl = fcpl;
}
test_attr_big(my_fcpl, my_fapl); /* Test storing big attribute */
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */
/* New attribute API routine tests
*/
test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */
test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */
test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */
test_attr_open_by_idx(new_format, my_fcpl, my_fapl); /* Test opening attributes by index */
test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */
test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */
/* Tests that address specific bugs
*/
test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */
test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */
test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */
test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */
/* test_attr_bug7 is specific to the "new" object header format,
* and in fact fails if used with the old format due to the
* attributes being larger than 64K */
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
/* tests specific to the "new format"
*/
if (new_format == TRUE) {
/* General attribute tests */
test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */
test_attr_dense_open(my_fcpl, my_fapl); /* Test opening attributes in dense storage */
@ -10873,12 +11022,8 @@ test_attr(void)
test_attr_dense_limits(my_fcpl, my_fapl); /* Test dense attribute storage limits */
test_attr_dense_dup_ids(my_fcpl, my_fapl); /* Test duplicated IDs for dense attribute storage */
test_attr_big(my_fcpl, my_fapl); /* Test storing big attribute */
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */
/* Attribute creation order tests */
/* Attribute creation order tests
*/
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
test_attr_corder_create_compact(my_fcpl, my_fapl); /* Test compact attribute storage on an object w/attribute creation order info */
test_attr_corder_create_dense(my_fcpl, my_fapl);/* Test dense attribute storage on an object w/attribute creation order info */
@ -10886,64 +11031,33 @@ test_attr(void)
test_attr_corder_transition(my_fcpl, my_fapl); /* Test attribute storage transitions on an object w/attribute creation order info */
test_attr_corder_delete(my_fcpl, my_fapl); /* Test deleting object using dense storage w/attribute creation order info */
/* New attribute API routine tests */
test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */
test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */
test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */
test_attr_open_by_idx(new_format, my_fcpl, my_fapl); /* Test opening attributes by index */
test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */
test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */
/* More complex tests with both "new format" and "shared" attributes */
/* More complex tests with exclusively both "new format" and "shared" attributes
*/
if(use_shared == TRUE) {
test_attr_shared_write(my_fcpl, my_fapl); /* Test writing to shared attributes in compact & dense storage */
test_attr_shared_rename(my_fcpl, my_fapl); /* Test renaming shared attributes in compact & dense storage */
test_attr_shared_delete(my_fcpl, my_fapl); /* Test deleting shared attributes in compact & dense storage */
test_attr_shared_unlink(my_fcpl, my_fapl); /* Test unlinking object with shared attributes in compact & dense storage */
} /* end if */
} /* if using shared attributes */
/* Tests that address specific bugs */
test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */
test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */
test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */
test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */
test_attr_delete_last_dense(my_fcpl, my_fapl);
/* test_attr_bug7 is specific to the "new" object header format,
* and in fact fails if used with the old format due to the
* attributes being larger than 64K */
test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
test_attr_delete_last_dense(my_fcpl, my_fapl); /* Test */
} /* end for */
} /* end if */
else {
/* General attribute tests */
test_attr_big(fcpl, my_fapl); /* Test storing big attribute */
test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */
/* New attribute API routine tests, on old-format storage */
test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */
test_attr_delete_by_idx(new_format, fcpl, my_fapl); /* Test deleting attribute by index */
test_attr_iterate2(new_format, fcpl, my_fapl); /* Test iterating over attributes by index */
test_attr_open_by_idx(new_format, fcpl, my_fapl); /* Test opening attributes by index */
test_attr_open_by_name(new_format, fcpl, my_fapl); /* Test opening attributes by name */
test_attr_create_by_name(new_format, fcpl, my_fapl); /* Test creating attributes by name */
} /* if using "new format" */
} /* for unshared/shared attributes */
} /* for old/new format */
/* Tests that address specific bugs */
test_attr_bug1(fcpl, my_fapl); /* Test odd allocation operations */
test_attr_bug2(fcpl, my_fapl); /* Test many deleted attributes */
test_attr_bug3(fcpl, my_fapl); /* Test "self referential" attributes */
test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */
/* Skip test_attr_bug7 because it is specific to the new object
* header format and in fact fails if used with the old format, due
* to the attributes being larger than 64K */
test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
test_attr_bug9(fcpl, my_fapl); /* Test large attributes converting to dense storage */
} /* end else */
} /* end for */
if (minimize_dset_oh != 0) {
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
dcpl_g = H5P_DEFAULT;
}
} /* for default/minimized dataset object headers */
/* Close FCPLs */
ret = H5Pclose(fcpl);

File diff suppressed because it is too large Load Diff