summaryrefslogtreecommitdiffstats
path: root/test/genall5.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/genall5.c')
-rw-r--r--test/genall5.c1400
1 files changed, 683 insertions, 717 deletions
diff --git a/test/genall5.c b/test/genall5.c
index 4cc0a2d..ca96eeb 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -14,7 +14,7 @@
/* Programmer: John Mainzer
* 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
+ * This file contains a heavily edited and functionally reduce
* version of the test code first written by Quincey in a file
* of the same name.
*/
@@ -22,12 +22,11 @@
#include "cache_common.h"
#include "genall5.h"
-#define DSET_DIMS (1024 * 1024)
-#define DSET_SMALL_DIMS (64 * 1024)
-#define DSET_CHUNK_DIMS 1024
+#define DSET_DIMS (1024 * 1024)
+#define DSET_SMALL_DIMS (64 * 1024)
+#define DSET_CHUNK_DIMS 1024
#define DSET_COMPACT_DIMS 4096
-
/*-------------------------------------------------------------------------
* Function: ns_grp_0
*
@@ -48,16 +47,17 @@
*/
void
-ns_grp_0(hid_t fid, const char *group_name) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+ns_grp_0(hid_t fid, const char *group_name)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
herr_t ret;
if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_0: H5Pcreate() failed";
}
HDassert(gcpl > 0);
@@ -67,7 +67,7 @@ ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
@@ -77,7 +77,7 @@ ns_grp_0(hid_t fid, const char *group_name) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_0: H5Gcreate2() failed";
}
HDassert(gid > 0);
@@ -87,7 +87,7 @@ ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
@@ -97,17 +97,14 @@ ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
}
HDassert(ret >= 0);
}
- return;
-
} /* ns_grp_0 */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_0
*
@@ -127,18 +124,20 @@ ns_grp_0(hid_t fid, const char *group_name) {
*-------------------------------------------------------------------------
*/
-void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+void
+vrfy_ns_grp_0(hid_t fid, const char *group_name)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
H5G_info_t grp_info;
- unsigned crt_order_flags = 0;
- herr_t ret;
+ unsigned crt_order_flags = 0;
+ herr_t ret;
if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
}
HDassert(gid > 0);
@@ -148,7 +147,7 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
gcpl = H5Gget_create_plist(gid);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
@@ -158,13 +157,12 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
@@ -174,7 +172,7 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
}
HDassert(ret >= 0);
@@ -185,24 +183,23 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
ret = H5Gget_info(gid, &grp_info);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_info() failed";
}
else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
else if (0 != grp_info.nlinks) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.nlinks";
}
else if (0 != grp_info.max_corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted) {
- pass = FALSE;
+ else if (FALSE != grp_info.mounted) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted";
}
@@ -210,23 +207,21 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
HDassert(0 == grp_info.max_corder);
- HDassert(false == grp_info.mounted);
+ HDassert(FALSE == grp_info.mounted);
}
if (pass) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_ns_grp_0() */
-
/*-------------------------------------------------------------------------
* Function: ns_grp_c
*
@@ -247,18 +242,19 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
*/
void
-ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
- herr_t ret;
+ herr_t ret;
if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed";
}
HDassert(gcpl > 0);
@@ -268,7 +264,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
@@ -278,7 +274,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Gcreate2() failed";
}
HDassert(gid > 0);
@@ -286,18 +282,18 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
if (pass) {
max_compact = 0;
- ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
+ ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Pget_link_phase_change() failed";
}
else if (nlinks <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: nlinks <= 0";
}
else if (nlinks >= max_compact) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: nlinks >= max_compact";
}
@@ -310,34 +306,32 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
while ((pass) && (u < nlinks)) {
char linkname[16];
- HDsprintf(linkname, "%u", u);
+ HDsnprintf(linkname, sizeof(linkname), "%u", u);
if (0 == (u % 3)) {
ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_soft() failed";
}
HDassert(ret >= 0);
} /* end if */
else if (1 == (u % 3)) {
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_hard() failed";
}
HDassert(ret >= 0);
} /* end else-if */
else {
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_external() failed";
}
HDassert(ret >= 0);
@@ -350,7 +344,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
@@ -360,17 +354,14 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_c: H5Gclose(gid) failed";
}
HDassert(ret >= 0);
}
- return;
-
} /* ns_grp_c() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_c
*
@@ -391,19 +382,20 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
*/
void
-vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
H5G_info_t grp_info;
- unsigned crt_order_flags = 0;
- unsigned u;
- herr_t ret;
+ unsigned crt_order_flags = 0;
+ unsigned u;
+ herr_t ret;
if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed";
}
HDassert(gid > 0);
@@ -413,7 +405,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
gcpl = H5Gget_create_plist(gid);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed";
}
HDassert(gcpl > 0);
@@ -423,11 +415,11 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
- pass = FALSE;
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
@@ -438,7 +430,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed";
}
HDassert(ret >= 0);
@@ -449,24 +441,23 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gget_info(gid, &grp_info);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_info() failed";
}
else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
else if (nlinks != grp_info.nlinks) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.nlinks";
}
else if (nlinks != grp_info.max_corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted) {
- pass = FALSE;
+ else if (FALSE != grp_info.mounted) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted";
}
@@ -474,45 +465,45 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
HDassert(nlinks == grp_info.max_corder);
- HDassert(false == grp_info.mounted);
+ HDassert(FALSE == grp_info.mounted);
}
u = 0;
while ((pass) && (u < nlinks)) {
- H5L_info_t lnk_info;
- char linkname[16];
- htri_t link_exists;
+ H5L_info2_t lnk_info;
+ char linkname[16];
+ htri_t link_exists;
- HDsprintf(linkname, "%u", u);
+ HDsnprintf(linkname, sizeof(linkname), "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
if (link_exists < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed";
}
HDassert(link_exists >= 0);
HDmemset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_info() failed";
}
- else if ( TRUE != lnk_info.corder_valid) {
- pass = FALSE;
+ else if (TRUE != lnk_info.corder_valid) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: TRUE != lnk_info.corder_valid";
}
else if (u != lnk_info.corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: u != lnk_info.corder";
}
else if (H5T_CSET_ASCII != lnk_info.cset) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
- HDassert(true == lnk_info.corder_valid);
+ HDassert(TRUE == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
@@ -520,32 +511,31 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
char *slinkval;
if (H5L_TYPE_SOFT != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_SOFT != lnk_info.type";
}
else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ slinkval = (char *)HDmalloc(lnk_info.u.val_size);
if (!slinkval) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed";
}
else if (0 != HDstrcmp(slinkval, group_name)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
@@ -554,37 +544,45 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
HDfree(slinkval);
} /* end if */
else if (1 == (u % 3)) {
- H5O_info_t root_oinfo;
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
if (H5L_TYPE_HARD != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Oget_info() failed.";
}
- else if (root_oinfo.addr != lnk_info.u.address) {
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
+ else {
+ if (H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_c: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_c: root_oinfo.token != lnk_info.u.token";
+ }
}
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else-if */
else {
- void *elinkval;
+ void * elinkval;
const char *file = NULL;
const char *path = NULL;
HDassert(2 == (u % 3));
if (H5L_TYPE_EXTERNAL != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
@@ -592,30 +590,29 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
elinkval = HDmalloc(lnk_info.u.val_size);
if (!elinkval) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed.";
}
HDassert(ret >= 0);
ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lunpack_elink_val() failed.";
}
else if (0 != HDstrcmp(file, "external.h5")) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(file, \"external.h5\")";
}
else if (0 != HDstrcmp(path, "/ext")) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
@@ -632,16 +629,14 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_ns_grp_c() */
-
/*-------------------------------------------------------------------------
* Function: ns_grp_d
*
@@ -662,18 +657,19 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
*/
void
-ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
- herr_t ret;
+ herr_t ret;
if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Pcreate() failed.";
}
HDassert(gcpl > 0);
@@ -683,7 +679,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
}
HDassert(ret >= 0);
@@ -693,7 +689,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
}
HDassert(gid > 0);
@@ -701,14 +697,14 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
if (pass) {
max_compact = 0;
- ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
+ ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
}
else if (nlinks <= max_compact) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: nlinks <= max_compact";
}
HDassert(ret >= 0);
@@ -719,24 +715,22 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
while ((pass) && (u < nlinks)) {
char linkname[16];
- HDsprintf(linkname, "%u", u);
+ HDsnprintf(linkname, sizeof(linkname), "%u", u);
if (0 == (u % 3)) {
- ret = H5Lcreate_soft(group_name, gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
} /* end if */
else if (1 == (u % 3)) {
- ret = H5Lcreate_hard(fid, "/", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
@@ -744,11 +738,10 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
else {
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
}
HDassert(ret >= 0);
@@ -761,7 +754,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Pclose() failed.";
}
HDassert(ret >= 0);
@@ -771,16 +764,14 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ns_grp_d: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* ns_grp_d() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_d
*
@@ -800,21 +791,21 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
*-------------------------------------------------------------------------
*/
-
void
-vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
H5G_info_t grp_info;
- unsigned crt_order_flags = 0;
- unsigned u;
- herr_t ret;
+ unsigned crt_order_flags = 0;
+ unsigned u;
+ herr_t ret;
if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
}
HDassert(gid > 0);
@@ -824,7 +815,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
gcpl = H5Gget_create_plist(gid);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
}
HDassert(gcpl > 0);
@@ -834,11 +825,11 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
}
else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
@@ -849,7 +840,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
}
HDassert(ret >= 0);
@@ -860,68 +851,68 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gget_info(gid, &grp_info);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
}
else if (H5G_STORAGE_TYPE_DENSE != grp_info.storage_type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
}
else if (nlinks != grp_info.nlinks) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
}
else if (nlinks != grp_info.max_corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted) {
- pass = FALSE;
+ else if (FALSE != grp_info.mounted) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
}
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
HDassert(nlinks == grp_info.max_corder);
- HDassert(false == grp_info.mounted);
+ HDassert(FALSE == grp_info.mounted);
}
u = 0;
while ((pass) && (u < nlinks)) {
- H5L_info_t lnk_info;
- char linkname[16];
- htri_t link_exists;
+ H5L_info2_t lnk_info;
+ char linkname[16];
+ htri_t link_exists;
- HDsprintf(linkname, "%u", u);
+ HDsnprintf(linkname, sizeof(linkname), "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
if (link_exists < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
}
HDassert(link_exists >= 0);
HDmemset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
}
else if (TRUE != lnk_info.corder_valid) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
}
else if (u != lnk_info.corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
}
else if (H5T_CSET_ASCII != lnk_info.cset) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
- HDassert(true == lnk_info.corder_valid);
+ HDassert(TRUE == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
@@ -929,32 +920,31 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
char *slinkval;
if (H5L_TYPE_SOFT != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
}
else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ slinkval = (char *)HDmalloc(lnk_info.u.val_size);
if (!slinkval) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
}
else if (0 != HDstrcmp(slinkval, group_name)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
@@ -963,36 +953,44 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
HDfree(slinkval);
} /* end if */
else if (1 == (u % 3)) {
- H5O_info_t root_oinfo;
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
if (H5L_TYPE_HARD != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
}
- else if (root_oinfo.addr != lnk_info.u.address) {
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
+ else {
+ if (H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: root_oinfo.token != lnk_info.u.token";
+ }
}
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else-if */
else {
- void *elinkval;
+ void * elinkval;
const char *file = NULL;
const char *path = NULL;
HDassert(2 == (u % 3));
if (H5L_TYPE_EXTERNAL != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
@@ -1000,30 +998,29 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
elinkval = HDmalloc(lnk_info.u.val_size);
if (!elinkval) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed.";
}
HDassert(ret >= 0);
ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lunpack_elink_val failed.";
}
else if (0 != HDstrcmp(file, "external.h5")) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(file, \"external.h5\").";
}
else if (0 != HDstrcmp(path, "/ext")) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
@@ -1040,17 +1037,14 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- return;
-
} /* vrfy_ns_grp_d() */
-
/*-------------------------------------------------------------------------
* Function: os_grp_0
*
@@ -1072,75 +1066,73 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
void
os_grp_0(hid_t fid, const char *group_name)
{
- hid_t gid = -1;
- hid_t fapl = -1;
+ hid_t gid = -1;
+ hid_t fapl = -1;
H5F_libver_t low, high;
herr_t ret;
- if ( pass ) { /* get the file's file access property list */
+ if (pass) { /* get the file's file access property list */
fapl = H5Fget_access_plist(fid);
- if ( fapl <= 0 ) {
- pass = FALSE;
+ if (fapl <= 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
}
HDassert(fapl > 0);
}
- if ( pass ) { /* get low and high bounds from fapl */
+ if (pass) { /* get low and high bounds from fapl */
ret = H5Pget_libver_bounds(fapl, &low, &high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
HDassert(ret >= 0);
}
- if ( pass ) { /* turn file format latest off */
- if(low >= H5F_LIBVER_V18) {
+ if (pass) { /* turn file format latest off */
+ if (low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
HDassert(ret >= 0);
}
}
- if ( pass ) {
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if ( gid <= 0 ) {
- pass = FALSE;
+ if (gid <= 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Gcreate2() failed.";
}
HDassert(gid > 0);
}
- if ( pass ) {
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- if ( pass ) { /* restore low and high bounds */
- if(low >= H5F_LIBVER_V18) {
+ if (pass) { /* restore low and high bounds */
+ if (low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
HDassert(ret >= 0);
}
}
- return;
} /* os_grp_0() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_os_grp_0
*
@@ -1160,18 +1152,19 @@ os_grp_0(hid_t fid, const char *group_name)
*/
void
-vrfy_os_grp_0(hid_t fid, const char *group_name) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+vrfy_os_grp_0(hid_t fid, const char *group_name)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
H5G_info_t grp_info;
- unsigned crt_order_flags = 0;
- herr_t ret;
+ unsigned crt_order_flags = 0;
+ herr_t ret;
if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
}
HDassert(gid > 0);
@@ -1181,7 +1174,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) {
gcpl = H5Gget_create_plist(gid);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
}
HDassert(gcpl > 0);
@@ -1192,11 +1185,11 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
}
else if (0 != crt_order_flags) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
}
HDassert(ret >= 0);
@@ -1207,7 +1200,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) {
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
}
HDassert(ret >= 0);
@@ -1218,46 +1211,44 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) {
ret = H5Gget_info(gid, &grp_info);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
}
else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
}
else if (0 != grp_info.nlinks) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
}
else if (0 != grp_info.max_corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted) {
- pass = FALSE;
+ else if (FALSE != grp_info.mounted) {
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
}
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
HDassert(0 == grp_info.max_corder);
- HDassert(false == grp_info.mounted);
+ HDassert(FALSE == grp_info.mounted);
}
if (pass) {
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_os_grp_0() */
-
/*-------------------------------------------------------------------------
* Function: os_grp_n
*
@@ -1280,45 +1271,45 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) {
void
os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
- hid_t gid = -1;
- unsigned u;
- hid_t fapl = -1;
+ hid_t gid = -1;
+ unsigned u;
+ hid_t fapl = -1;
H5F_libver_t low, high;
- herr_t ret;
+ herr_t ret;
- if ( pass ) { /* get the file's file access property list */
+ if (pass) { /* get the file's file access property list */
fapl = H5Fget_access_plist(fid);
- if ( fapl <= 0 ) {
- pass = FALSE;
+ if (fapl <= 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
}
HDassert(fapl > 0);
}
- if ( pass ) { /* get low and high bounds from fapl */
+ if (pass) { /* get low and high bounds from fapl */
ret = H5Pget_libver_bounds(fapl, &low, &high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
HDassert(ret >= 0);
}
- if ( pass ) { /* turn file format latest off */
- if(low >= H5F_LIBVER_V18) {
+ if (pass) { /* turn file format latest off */
+ if (low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
HDassert(ret >= 0);
}
}
- if ( pass ) {
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if ( gid <= 0 ) {
- pass = FALSE;
+ if (gid <= 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
HDassert(gid > 0);
@@ -1327,15 +1318,15 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
HDassert(nlinks > 0);
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
+ while ((pass) && (u < nlinks)) {
char linkname[32];
- HDsprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsnprintf(linkname, sizeof(linkname), "ln%d_%u", proc_num, u);
- if(0 == (u % 2)) {
+ if (0 == (u % 2)) {
ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
@@ -1344,41 +1335,39 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
HDassert(1 == (u % 2));
ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
} /* end else */
- u++;
+ u++;
} /* end while */
- if ( pass ) {
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- if ( pass ) { /* restore low and high bounds */
- if(low >= H5F_LIBVER_V18) {
+ if (pass) { /* restore low and high bounds */
+ if (low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
- if ( ret < 0 ) {
- pass = FALSE;
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
}
HDassert(ret >= 0);
}
}
- return;
} /* os_grp_n() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_os_grp_n
*
@@ -1398,20 +1387,20 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*-------------------------------------------------------------------------
*/
void
-vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
- unsigned nlinks) {
- hid_t gid = -1;
- hid_t gcpl = -1;
+vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
+{
+ hid_t gid = -1;
+ hid_t gcpl = -1;
H5G_info_t grp_info;
- unsigned crt_order_flags = 0;
- unsigned u;
- herr_t ret;
+ unsigned crt_order_flags = 0;
+ unsigned u;
+ herr_t ret;
if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
if (gid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
}
HDassert(gid > 0);
@@ -1421,7 +1410,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
gcpl = H5Gget_create_plist(gid);
if (gcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
@@ -1431,11 +1420,11 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
}
else if (0 != crt_order_flags) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
}
HDassert(ret >= 0);
@@ -1446,7 +1435,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
ret = H5Pclose(gcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
}
HDassert(ret >= 0);
@@ -1458,97 +1447,96 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
ret = H5Gget_info(gid, &grp_info);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
}
else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
}
else if (nlinks != grp_info.nlinks) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
}
else if (0 != grp_info.max_corder) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted) {
- pass = FALSE;
+ else if (FALSE != grp_info.mounted) {
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
}
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
HDassert(0 == grp_info.max_corder);
- HDassert(false == grp_info.mounted);
+ HDassert(FALSE == grp_info.mounted);
}
u = 0;
while ((pass) && (u < nlinks)) {
- H5L_info_t lnk_info;
- char linkname[32];
- htri_t link_exists;
+ H5L_info2_t lnk_info;
+ char linkname[32];
+ htri_t link_exists;
- HDsprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsnprintf(linkname, sizeof(linkname), "ln%d_%u", proc_num, u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
if (link_exists < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
}
HDassert(link_exists >= 0);
HDmemset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
}
- else if ( FALSE != lnk_info.corder_valid) {
- pass = FALSE;
+ else if (FALSE != lnk_info.corder_valid) {
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
}
else if (H5T_CSET_ASCII != lnk_info.cset) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
- HDassert(false == lnk_info.corder_valid);
+ HDassert(FALSE == lnk_info.corder_valid);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
if (0 == (u % 2)) {
char *slinkval;
if (H5L_TYPE_SOFT != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
}
else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ slinkval = (char *)HDmalloc(lnk_info.u.val_size);
if (!slinkval) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
}
else if (0 != HDstrcmp(slinkval, group_name)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
@@ -1557,29 +1545,37 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
HDfree(slinkval);
} /* end if */
else {
- H5O_info_t root_oinfo;
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
HDassert(1 == (u % 2));
if (H5L_TYPE_HARD != lnk_info.type) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
}
- else if (root_oinfo.addr != lnk_info.u.address) {
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
+ else {
+ if (H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: root_oinfo.token != lnk_info.u.token";
+ }
}
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else */
u++;
@@ -1589,16 +1585,14 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
ret = H5Gclose(gid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_os_grp_n() */
-
/*-------------------------------------------------------------------------
* Function: ds_ctg_i
*
@@ -1619,30 +1613,30 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
*-------------------------------------------------------------------------
*/
void
-ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *wdata = NULL;
+ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * wdata = NULL;
unsigned u;
- hid_t dsid = -1;
- hid_t sid = -1;
- hsize_t dims[1] = { DSET_DIMS };
- herr_t ret;
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hsize_t dims[1] = {DSET_DIMS};
+ herr_t ret;
if (pass) {
sid = H5Screate_simple(1, dims, NULL);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
}
HDassert(sid > 0);
}
if (pass) {
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
@@ -1652,17 +1646,17 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: H5Sclose() failed";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
+ wdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS);
if (!wdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
@@ -1670,34 +1664,31 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int) u;
+ wdata[u] = (int)u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
-
- HDfree(wdata);
}
+ HDfree(wdata);
+
if (pass) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
- return;
} /* ds_ctg_i */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_i
*
@@ -1717,25 +1708,26 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *rdata = NULL;
- unsigned u;
- hid_t dsid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
+vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * rdata = NULL;
+ unsigned u;
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ hid_t dcpl = -1;
H5D_space_status_t allocation;
- H5D_layout_t layout;
- int ndims;
- hsize_t dims[1], max_dims[1];
- htri_t type_equal;
- herr_t ret;
+ H5D_layout_t layout;
+ int ndims;
+ hsize_t dims[1], max_dims[1];
+ htri_t type_equal;
+ herr_t ret;
if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
}
HDassert(dsid > 0);
@@ -1745,7 +1737,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
sid = H5Dget_space(dsid);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
}
HDassert(sid > 0);
@@ -1755,7 +1747,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ndims = H5Sget_simple_extent_ndims(sid);
if (1 != ndims) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
}
HDassert(1 == ndims);
@@ -1765,15 +1757,15 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
}
- else if ( DSET_DIMS != dims[0]) {
- pass = FALSE;
+ else if (DSET_DIMS != dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
}
- else if ( DSET_DIMS != max_dims[0]) {
- pass = FALSE;
+ else if (DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
}
HDassert(ret >= 0);
@@ -1785,7 +1777,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
}
HDassert(ret >= 0);
@@ -1795,7 +1787,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
tid = H5Dget_type(dsid);
if (tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
}
HDassert(tid > 0);
@@ -1805,7 +1797,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
if (1 != type_equal) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
}
HDassert(1 == type_equal);
@@ -1815,7 +1807,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -1825,28 +1817,27 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dget_space_status(dsid, &allocation);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
}
else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
}
- else if (!write_data
- && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
- pass = FALSE;
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
}
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
- || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
+ (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
if (pass) {
dcpl = H5Dget_create_plist(dsid);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
}
HDassert(dcpl > 0);
@@ -1856,7 +1847,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
layout = H5Pget_layout(dcpl);
if (H5D_CONTIGUOUS != layout) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
}
HDassert(H5D_CONTIGUOUS == layout);
@@ -1866,27 +1857,26 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
+ rdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS);
if (!rdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed.";
}
HDassert(rdata);
}
if ((pass) && (write_data)) {
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
}
HDassert(ret >= 0);
@@ -1894,32 +1884,29 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_DIMS; u++) {
- if ((int) u != rdata[u]) {
- pass = FALSE;
+ if ((int)u != rdata[u]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
break;
}
- HDassert((int )u == rdata[u]);
+ HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
- return;
-
} /* vrfy_ds_ctg_i() */
-
/*-------------------------------------------------------------------------
* Function: ds_chk_i
*
@@ -1940,21 +1927,22 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *wdata = NULL;
+ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * wdata = NULL;
unsigned u;
- hid_t dsid = -1;
- hid_t dcpl = -1;
- hid_t sid = -1;
- hsize_t dims[1] = { DSET_DIMS };
- hsize_t chunk_dims[1] = { DSET_CHUNK_DIMS };
- herr_t ret;
+ hid_t dsid = -1;
+ hid_t dcpl = -1;
+ hid_t sid = -1;
+ hsize_t dims[1] = {DSET_DIMS};
+ hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS};
+ herr_t ret;
if (pass) {
sid = H5Screate_simple(1, dims, NULL);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
}
HDassert(sid > 0);
@@ -1964,7 +1952,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Pcreate() failed.";
}
HDassert(dcpl > 0);
@@ -1974,18 +1962,17 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pset_chunk(dcpl, 1, chunk_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
}
HDassert(ret >= 0);
}
if (pass) {
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
@@ -1995,7 +1982,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Pclose() failed.";
}
HDassert(ret >= 0);
@@ -2005,17 +1992,17 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Sclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
+ wdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS);
if (!wdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
@@ -2023,12 +2010,11 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int) u;
+ wdata[u] = (int)u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
@@ -2039,16 +2025,14 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_chk_i: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* ds_chk_i */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ds_chk_i
*
@@ -2068,25 +2052,26 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *rdata = NULL;
- unsigned u;
- hid_t dsid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
+vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * rdata = NULL;
+ unsigned u;
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ hid_t dcpl = -1;
H5D_space_status_t allocation;
- H5D_layout_t layout;
- int ndims;
- hsize_t dims[1], max_dims[1], chunk_dims[1];
- htri_t type_equal;
- herr_t ret;
+ H5D_layout_t layout;
+ int ndims;
+ hsize_t dims[1], max_dims[1], chunk_dims[1];
+ htri_t type_equal;
+ herr_t ret;
if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
}
HDassert(dsid > 0);
@@ -2096,7 +2081,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
sid = H5Dget_space(dsid);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
}
HDassert(sid > 0);
@@ -2106,7 +2091,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ndims = H5Sget_simple_extent_ndims(sid);
if (1 != ndims) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
}
HDassert(1 == ndims);
@@ -2116,15 +2101,15 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
}
- else if ( DSET_DIMS != dims[0]) {
- pass = FALSE;
+ else if (DSET_DIMS != dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
}
- else if ( DSET_DIMS != max_dims[0]) {
- pass = FALSE;
+ else if (DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
}
HDassert(ret >= 0);
@@ -2136,7 +2121,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
}
HDassert(ret >= 0);
@@ -2146,7 +2131,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
tid = H5Dget_type(dsid);
if (tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
}
HDassert(tid > 0);
@@ -2156,7 +2141,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
if (1 != type_equal) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
}
HDassert(1 == type_equal);
@@ -2166,7 +2151,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -2176,27 +2161,27 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dget_space_status(dsid, &allocation);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
}
else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
}
else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
}
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
- || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
+ (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
if (pass) {
dcpl = H5Dget_create_plist(dsid);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
}
HDassert(dcpl > 0);
@@ -2206,7 +2191,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
layout = H5Pget_layout(dcpl);
if (H5D_CHUNKED != layout) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
}
HDassert(H5D_CHUNKED == layout);
@@ -2216,11 +2201,11 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pget_chunk(dcpl, 1, chunk_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
}
- else if ( DSET_CHUNK_DIMS != chunk_dims[0]) {
- pass = FALSE;
+ else if (DSET_CHUNK_DIMS != chunk_dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: ";
}
HDassert(ret >= 0);
@@ -2231,17 +2216,17 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
+ rdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS);
if (!rdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed.";
}
HDassert(rdata);
@@ -2250,7 +2235,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
}
HDassert(ret >= 0);
@@ -2258,31 +2243,29 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_DIMS; u++) {
- if ((int) u != rdata[u]) {
- pass = FALSE;
+ if ((int)u != rdata[u]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
break;
}
- HDassert((int )u == rdata[u]);
+ HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_chk_i() */
-
/*-------------------------------------------------------------------------
* Function: ds_cpt_i
*
@@ -2303,20 +2286,21 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *wdata = NULL;
+ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * wdata = NULL;
unsigned u;
- hid_t dsid = -1;
- hid_t dcpl = -1;
- hid_t sid = -1;
- hsize_t dims[1] = { DSET_COMPACT_DIMS };
- herr_t ret;
+ hid_t dsid = -1;
+ hid_t dcpl = -1;
+ hid_t sid = -1;
+ hsize_t dims[1] = {DSET_COMPACT_DIMS};
+ herr_t ret;
if (pass) {
sid = H5Screate_simple(1, dims, NULL);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
}
HDassert(sid > 0);
@@ -2326,7 +2310,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
}
HDassert(dcpl > 0);
@@ -2336,18 +2320,17 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pset_layout(dcpl, H5D_COMPACT);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
}
HDassert(ret >= 0);
}
if (pass) {
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
}
HDassert(dsid > 0);
@@ -2357,7 +2340,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Pclose() failed.";
}
HDassert(ret >= 0);
@@ -2367,17 +2350,17 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Sclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- wdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
+ wdata = (int *)HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
if (!wdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
@@ -2385,13 +2368,12 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_COMPACT_DIMS; u++)
- wdata[u] = (int) u;
+ wdata[u] = (int)u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
@@ -2403,17 +2385,14 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_cpt_i: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
-
} /* ds_cpt_i() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ds_cpt_i
*
@@ -2433,25 +2412,26 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
- int *rdata = NULL;
- unsigned u;
- hid_t dsid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
+vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ int * rdata = NULL;
+ unsigned u;
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ hid_t dcpl = -1;
H5D_space_status_t allocation;
- H5D_layout_t layout;
- int ndims;
- hsize_t dims[1], max_dims[1];
- htri_t type_equal;
- herr_t ret;
+ H5D_layout_t layout;
+ int ndims;
+ hsize_t dims[1], max_dims[1];
+ htri_t type_equal;
+ herr_t ret;
if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
}
HDassert(dsid > 0);
@@ -2461,7 +2441,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
sid = H5Dget_space(dsid);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
}
HDassert(sid > 0);
@@ -2471,7 +2451,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ndims = H5Sget_simple_extent_ndims(sid);
if (1 != ndims) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
}
HDassert(1 == ndims);
@@ -2481,15 +2461,15 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
}
- else if ( DSET_COMPACT_DIMS != dims[0]) {
- pass = FALSE;
+ else if (DSET_COMPACT_DIMS != dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
}
- else if ( DSET_COMPACT_DIMS != max_dims[0]) {
- pass = FALSE;
+ else if (DSET_COMPACT_DIMS != max_dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
}
HDassert(ret >= 0);
@@ -2501,7 +2481,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
}
HDassert(ret >= 0);
@@ -2511,7 +2491,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
tid = H5Dget_type(dsid);
if (tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
}
HDassert(tid > 0);
@@ -2521,7 +2501,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
if (1 != type_equal) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
}
HDassert(1 == type_equal);
@@ -2531,7 +2511,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -2541,13 +2521,12 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dget_space_status(dsid, &allocation);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
}
else if (H5D_SPACE_STATUS_ALLOCATED != allocation) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
}
HDassert(ret >= 0);
HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation);
@@ -2557,7 +2536,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
dcpl = H5Dget_create_plist(dsid);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
}
HDassert(dcpl > 0);
@@ -2567,7 +2546,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
layout = H5Pget_layout(dcpl);
if (H5D_COMPACT != layout) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
}
HDassert(H5D_COMPACT == layout);
@@ -2577,27 +2556,26 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- rdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
+ rdata = (int *)HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
if (!rdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed.";
}
HDassert(rdata);
}
if ((pass) && (write_data)) {
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
}
HDassert(ret >= 0);
@@ -2605,31 +2583,29 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_COMPACT_DIMS; u++) {
- if ((int) u != rdata[u]) {
- pass = FALSE;
+ if ((int)u != rdata[u]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
break;
}
- HDassert((int )u == rdata[u]);
+ HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_cpt_i() */
-
/*-------------------------------------------------------------------------
* Function: ds_ctg_v
*
@@ -2650,20 +2626,21 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
- hid_t dsid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hsize_t dims[1] = { DSET_SMALL_DIMS };
- herr_t ret;
- hvl_t *wdata = NULL;
+ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ hsize_t dims[1] = {DSET_SMALL_DIMS};
+ herr_t ret;
+ hvl_t * wdata = NULL;
unsigned u;
if (pass) {
sid = H5Screate_simple(1, dims, NULL);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Screate_simple";
}
HDassert(sid > 0);
@@ -2673,28 +2650,27 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
tid = H5Tvlen_create(H5T_NATIVE_INT);
if (tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
}
HDassert(tid > 0);
}
if (pass) {
- dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
}
HDassert(dsid > 0);
}
if ((pass) && (write_data)) {
- wdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ wdata = (hvl_t *)HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
if (!wdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: HDmalloc of wdata failed.";
}
HDassert(wdata);
@@ -2702,25 +2678,25 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
if ((pass) && (write_data)) {
for (u = 0; u < DSET_SMALL_DIMS; u++) {
- int *tdata;
+ int * tdata;
unsigned len;
unsigned v;
- len = (u % 10) + 1;
- tdata = (int *) HDmalloc(sizeof(int) * len);
+ len = (u % 10) + 1;
+ tdata = (int *)HDmalloc(sizeof(int) * len);
if (!tdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: HDmalloc of tdata failed.";
break;
}
HDassert(tdata);
for (v = 0; v < len; v++)
- tdata[v] = (int) (u + v);
+ tdata[v] = (int)(u + v);
wdata[u].len = len;
- wdata[u].p = tdata;
+ wdata[u].p = tdata;
} /* end for */
}
@@ -2728,18 +2704,18 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, wdata);
if (ret < 0) {
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Treclaim() failed.";
}
HDassert(ret >= 0);
@@ -2750,7 +2726,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sclose(sid);
if (sid < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Sclose() failed.";
}
HDassert(ret >= 0);
@@ -2760,7 +2736,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tid);
if (tid < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -2770,16 +2746,14 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "ds_ctg_v: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* ds_ctg_v() */
-
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_v
*
@@ -2799,26 +2773,27 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
*-------------------------------------------------------------------------
*/
void
-vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
- hid_t dsid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hid_t tmp_tid = -1;
- hid_t dcpl = -1;
+vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
+{
+ hid_t dsid = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ hid_t tmp_tid = -1;
+ hid_t dcpl = -1;
H5D_space_status_t allocation;
- H5D_layout_t layout;
- int ndims;
- hsize_t dims[1], max_dims[1];
- htri_t type_equal;
- hvl_t *rdata = NULL;
- unsigned u;
- herr_t ret;
+ H5D_layout_t layout;
+ int ndims;
+ hsize_t dims[1], max_dims[1];
+ htri_t type_equal;
+ hvl_t * rdata = NULL;
+ unsigned u;
+ herr_t ret;
if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
if (dsid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
}
HDassert(dsid > 0);
@@ -2828,7 +2803,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
sid = H5Dget_space(dsid);
if (sid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
}
HDassert(sid > 0);
@@ -2838,7 +2813,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ndims = H5Sget_simple_extent_ndims(sid);
if (1 != ndims) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
}
HDassert(1 == ndims);
@@ -2848,15 +2823,15 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
}
- else if ( DSET_SMALL_DIMS != dims[0]) {
- pass = FALSE;
+ else if (DSET_SMALL_DIMS != dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
}
- else if ( DSET_SMALL_DIMS != max_dims[0]) {
- pass = FALSE;
+ else if (DSET_SMALL_DIMS != max_dims[0]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
}
HDassert(ret >= 0);
@@ -2868,7 +2843,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
tid = H5Dget_type(dsid);
if (tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
}
HDassert(tid > 0);
@@ -2878,7 +2853,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
tmp_tid = H5Tvlen_create(H5T_NATIVE_INT);
if (tmp_tid <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
}
HDassert(tmp_tid > 0);
@@ -2888,7 +2863,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
type_equal = H5Tequal(tid, tmp_tid);
if (1 != type_equal) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
}
HDassert(1 == type_equal);
@@ -2898,7 +2873,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tmp_tid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -2908,30 +2883,27 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dget_space_status(dsid, &allocation);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
}
else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
}
- else if (!write_data
- && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
}
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
- || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
+ (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
if (pass) {
dcpl = H5Dget_create_plist(dsid);
if (dcpl <= 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
}
HDassert(dcpl > 0);
@@ -2941,7 +2913,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
layout = H5Pget_layout(dcpl);
if (H5D_CONTIGUOUS != layout) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
}
HDassert(H5D_CONTIGUOUS == layout);
@@ -2951,17 +2923,17 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Pclose(dcpl);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
}
HDassert(ret >= 0);
}
if ((pass) && (write_data)) {
- rdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ rdata = (hvl_t *)HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
if (!rdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed.";
}
HDassert(rdata);
@@ -2971,7 +2943,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dread(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
}
HDassert(ret >= 0);
@@ -2982,43 +2954,43 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
unsigned len;
unsigned v;
- len = (unsigned) rdata[u].len;
+ len = (unsigned)rdata[u].len;
for (v = 0; v < len; v++) {
- int *tdata = (int *) rdata[u].p;
+ int *tdata = (int *)rdata[u].p;
if (!tdata) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: !tdata";
break;
}
- else if ((int) (u + v) != tdata[v]) {
- pass = FALSE;
+ else if ((int)(u + v) != tdata[v]) {
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
break;
}
HDassert(tdata);
- HDassert((int )(u + v) == tdata[v]);
+ HDassert((int)(u + v) == tdata[v]);
} /* end for */
- } /* end for */
+ } /* end for */
}
if ((pass) && (write_data)) {
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rdata);
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, rdata);
if (ret < 0) {
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Treclaim() failed.";
}
HDassert(ret >= 0);
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Sclose(sid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
}
HDassert(ret >= 0);
@@ -3028,7 +3000,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Tclose(tid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
}
HDassert(ret >= 0);
@@ -3038,16 +3010,14 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
ret = H5Dclose(dsid);
if (ret < 0) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
}
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_ctg_v() */
-
/*-------------------------------------------------------------------------
* Function: create_zoo
*
@@ -3085,27 +3055,27 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
HDassert(base_path);
/* Add & verify an empty "new style" group */
- if ( pass ) {
- HDsprintf(full_path, "%s/A", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path);
HDassert(HDstrlen(full_path) < 1024);
ns_grp_0(fid, full_path);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/A", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* Add & verify a compact "new style" group (3 link messages) */
- if ( pass ) {
- HDsprintf(full_path, "%s/B", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path);
HDassert(HDstrlen(full_path) < 1024);
ns_grp_c(fid, full_path, 3);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/B", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
@@ -3113,27 +3083,27 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/C", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path);
HDassert(HDstrlen(full_path) < 1024);
ns_grp_d(fid, full_path, 300);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/C", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* Add & verify an empty "old style" group to file */
- if ( pass ) {
- HDsprintf(full_path, "%s/D", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path);
HDassert(HDstrlen(full_path) < 1024);
os_grp_0(fid, full_path);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/D", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
@@ -3141,14 +3111,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify an "old style" group (w/300 links, in v1 B-tree &
* local heap) to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/E", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path);
HDassert(HDstrlen(full_path) < 1024);
os_grp_n(fid, full_path, proc_num, 300);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/E", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
@@ -3156,14 +3126,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a contiguous dataset w/integer datatype (but no data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/F", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, FALSE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/F", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
@@ -3171,14 +3141,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a contiguous dataset w/integer datatype (with data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/G", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, TRUE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/G", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
@@ -3186,14 +3156,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a chunked dataset w/integer datatype (but no data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/H", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, FALSE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/H", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
@@ -3201,14 +3171,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a chunked dataset w/integer datatype (and data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/I", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, TRUE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/I", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
@@ -3216,14 +3186,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a compact dataset w/integer datatype (but no data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/J", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, FALSE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/J", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
@@ -3231,14 +3201,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a compact dataset w/integer datatype (and data)
* to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/K", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, TRUE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/K", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
@@ -3246,14 +3216,14 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a contiguous dataset w/variable-length datatype
* (but no data) to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/L", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, FALSE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/L", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
@@ -3261,22 +3231,20 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify a contiguous dataset w/variable-length datatype
* (and data) to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/M", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path);
HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, TRUE);
}
- if ( pass ) {
- HDsprintf(full_path, "%s/M", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
- return;
} /* create_zoo() */
-
/*-------------------------------------------------------------------------
* Function: validate_zoo
*
@@ -3312,15 +3280,15 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
HDassert(base_path);
/* validate an empty "new style" group */
- if ( pass ) {
- HDsprintf(full_path, "%s/A", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* validate a compact "new style" group (3 link messages) */
- if ( pass ) {
- HDsprintf(full_path, "%s/B", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
@@ -3328,15 +3296,15 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/C", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* validate an empty "old style" group in file */
- if ( pass ) {
- HDsprintf(full_path, "%s/D", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
@@ -3344,8 +3312,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate an "old style" group (w/300 links, in v1 B-tree &
* local heap)
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/E", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
@@ -3353,8 +3321,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a contiguous dataset w/integer datatype (but no data)
* in file.
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/F", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
@@ -3362,8 +3330,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a contiguous dataset w/integer datatype (with data)
* in file.
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/G", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
@@ -3371,8 +3339,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a chunked dataset w/integer datatype (but no data)
* in file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/H", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
@@ -3380,8 +3348,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a chunked dataset w/integer datatype (and data)
* in file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/I", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
@@ -3389,8 +3357,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* Validate a compact dataset w/integer datatype (but no data)
* in file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/J", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
@@ -3398,8 +3366,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a compact dataset w/integer datatype (and data)
* in file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/K", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
@@ -3407,8 +3375,8 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a contiguous dataset w/variable-length datatype
* (but no data) to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/L", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
@@ -3416,12 +3384,10 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate a contiguous dataset w/variable-length datatype
* (and data) to file
*/
- if ( pass ) {
- HDsprintf(full_path, "%s/M", base_path);
+ if (pass) {
+ HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path);
HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
- return;
} /* validate_zoo() */
-