summaryrefslogtreecommitdiffstats
path: root/test/tattr.c
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2018-11-19 20:08:31 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2018-11-19 20:08:31 (GMT)
commit1fed1a7be74d0d837bc1cde2ef5d3ad8341ad4fc (patch)
tree437a6f8c97a028ed942f4dd64263049e2437df24 /test/tattr.c
parentf5114fcddb654783af384e00035ea6e8bb63fc9b (diff)
downloadhdf5-1fed1a7be74d0d837bc1cde2ef5d3ad8341ad4fc.zip
hdf5-1fed1a7be74d0d837bc1cde2ef5d3ad8341ad4fc.tar.gz
hdf5-1fed1a7be74d0d837bc1cde2ef5d3ad8341ad4fc.tar.bz2
Incorporate minimized dset ohdr tests into extant suite.
Diffstat (limited to 'test/tattr.c')
-rw-r--r--test/tattr.c430
1 files changed, 272 insertions, 158 deletions
diff --git a/test/tattr.c b/test/tattr.c
index 4358d4c..75768b9 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -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;
-
- /* 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 */
-
+ for(use_shared = FALSE; use_shared <= TRUE; use_shared++) {
+ hid_t my_fcpl;
+
+ 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 */
+
+ test_attr_delete_last_dense(my_fcpl, my_fapl);
- /* 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_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 */
-
- /* 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 using "new format" */
+ } /* for unshared/shared attributes */
+ } /* for old/new format */
+
+ 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);