summaryrefslogtreecommitdiffstats
path: root/test/cmpd_dset.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-01-28 17:19:09 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-01-28 17:19:09 (GMT)
commitb698574fce26e8cf5134ea9268f1bca25baf9a46 (patch)
treeee709f3b4aab87f56958b5ded02c53b5348b7b9b /test/cmpd_dset.c
parent91c1a6df54836d585dcab57b6453867290da5eb8 (diff)
downloadhdf5-b698574fce26e8cf5134ea9268f1bca25baf9a46.zip
hdf5-b698574fce26e8cf5134ea9268f1bca25baf9a46.tar.gz
hdf5-b698574fce26e8cf5134ea9268f1bca25baf9a46.tar.bz2
[svn-r16370] Modify test_pack_ooo to always output the state of randomly generated variables
when it fails, even in the sections that do not use the random variables. Tested: jam
Diffstat (limited to 'test/cmpd_dset.c')
-rw-r--r--test/cmpd_dset.c82
1 files changed, 37 insertions, 45 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index c05844e..d1f317f 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -1840,117 +1840,109 @@ test_pack_ooo(void)
PASSED();
- /* Change to reverse ordering, insert compound last */
- for(i=0; i<PACK_NMEMBS; i++)
- order[i] = PACK_NMEMBS - i - 1;
- sub_cmpd_order = PACK_NMEMBS - 1;
-
TESTING("reverse member insertion with empty compound subtype");
/* Create inner compound type. It will be empty for the first run */
- if((sub_cmpd = H5Tcreate(H5T_COMPOUND, 4)) < 0) TEST_ERROR
+ if((sub_cmpd = H5Tcreate(H5T_COMPOUND, 4)) < 0) PACK_OOO_ERROR
/* Create main compound type, with extra space at the end */
- if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) TEST_ERROR
+ if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) PACK_OOO_ERROR
- /* Insert the compound members in the reverse order previously generated */
+ /* Insert the compound members in reverse order, with compound last */
for(i=0; i<PACK_NMEMBS; i++) {
sprintf(name, "%05d", i);
- if(i == sub_cmpd_order) {
- if(H5Tinsert(cmpd, name, 4 * order[i], sub_cmpd) < 0) TEST_ERROR
+ if(i == PACK_NMEMBS - 1) {
+ if(H5Tinsert(cmpd, name, 4 * (PACK_NMEMBS - i - 1), sub_cmpd) < 0) PACK_OOO_ERROR
} else
- if(H5Tinsert(cmpd, name, 4 * order[i], H5T_STD_I32BE) < 0) TEST_ERROR
+ if(H5Tinsert(cmpd, name, 4 * (PACK_NMEMBS - i - 1), H5T_STD_I32BE) < 0) PACK_OOO_ERROR
} /* end for */
/* Verify that the compound is not packed */
- if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) TEST_ERROR
- if(dt->shared->u.compnd.packed) TEST_ERROR
+ if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) PACK_OOO_ERROR
+ if(dt->shared->u.compnd.packed) PACK_OOO_ERROR
/* Close the main compound */
- if(H5Tclose(cmpd) < 0) TEST_ERROR
+ if(H5Tclose(cmpd) < 0) PACK_OOO_ERROR
PASSED();
TESTING("reverse member insertion with full compound subtype");
/* Complete the inner compound type */
- if(H5Tinsert(sub_cmpd, "int", 0, H5T_STD_I32LE) < 0) TEST_ERROR
+ if(H5Tinsert(sub_cmpd, "int", 0, H5T_STD_I32LE) < 0) PACK_OOO_ERROR
/* Recreate main compound type */
- if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) TEST_ERROR
+ if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) PACK_OOO_ERROR
- /* Insert the compound members in the reverse order previously generated */
+ /* Insert the compound members in reverse order, with compound last */
for(i=0; i<PACK_NMEMBS; i++) {
sprintf(name, "%05d", i);
- if(i == sub_cmpd_order) {
- if(H5Tinsert(cmpd, name, 4 * order[i], sub_cmpd) < 0) TEST_ERROR
+ if(i == PACK_NMEMBS - 1) {
+ if(H5Tinsert(cmpd, name, 4 * (PACK_NMEMBS - i - 1), sub_cmpd) < 0) PACK_OOO_ERROR
} else
- if(H5Tinsert(cmpd, name, 4 * order[i], H5T_STD_I32BE) < 0) TEST_ERROR
+ if(H5Tinsert(cmpd, name, 4 * (PACK_NMEMBS - i - 1), H5T_STD_I32BE) < 0) PACK_OOO_ERROR
} /* end for */
/* Verify that the compound is packed */
- if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) TEST_ERROR
- if(!dt->shared->u.compnd.packed) TEST_ERROR
+ if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) PACK_OOO_ERROR
+ if(!dt->shared->u.compnd.packed) PACK_OOO_ERROR
/* Close */
- if(H5Tclose(cmpd) < 0) TEST_ERROR
- if(H5Tclose(sub_cmpd) < 0) TEST_ERROR
+ if(H5Tclose(cmpd) < 0) PACK_OOO_ERROR
+ if(H5Tclose(sub_cmpd) < 0) PACK_OOO_ERROR
PASSED();
- /* Change to forward ordering, insert compound first */
- sub_cmpd_order = 0;
-
TESTING("forward member insertion with empty compound subtype");
/* Create inner compound type. It will be empty for the first run */
- if((sub_cmpd = H5Tcreate(H5T_COMPOUND, 4)) < 0) TEST_ERROR
+ if((sub_cmpd = H5Tcreate(H5T_COMPOUND, 4)) < 0) PACK_OOO_ERROR
/* Create main compound type, with extra space at the end */
- if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) TEST_ERROR
+ if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) PACK_OOO_ERROR
- /* Insert the compound members in forward order */
+ /* Insert the compound members in forward order, with compound first */
for(i=0; i<PACK_NMEMBS; i++) {
sprintf(name, "%05d", i);
- if(i == sub_cmpd_order) {
- if(H5Tinsert(cmpd, name, 4 * i, sub_cmpd) < 0) TEST_ERROR
+ if(i == 0) {
+ if(H5Tinsert(cmpd, name, 4 * i, sub_cmpd) < 0) PACK_OOO_ERROR
} else
- if(H5Tinsert(cmpd, name, 4 * i, H5T_STD_I32BE) < 0) TEST_ERROR
+ if(H5Tinsert(cmpd, name, 4 * i, H5T_STD_I32BE) < 0) PACK_OOO_ERROR
} /* end for */
/* Verify that the compound is not packed */
- if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) TEST_ERROR
- if(dt->shared->u.compnd.packed) TEST_ERROR
+ if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) PACK_OOO_ERROR
+ if(dt->shared->u.compnd.packed) PACK_OOO_ERROR
/* Close the main compound */
- if(H5Tclose(cmpd) < 0) TEST_ERROR
+ if(H5Tclose(cmpd) < 0) PACK_OOO_ERROR
PASSED();
TESTING("forward member insertion with full compound subtype");
/* Complete the inner compound type */
- if(H5Tinsert(sub_cmpd, "int", 0, H5T_STD_I32LE) < 0) TEST_ERROR
+ if(H5Tinsert(sub_cmpd, "int", 0, H5T_STD_I32LE) < 0) PACK_OOO_ERROR
/* Recreate main compound type */
- if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) TEST_ERROR
+ if((cmpd = H5Tcreate(H5T_COMPOUND, (4 * PACK_NMEMBS) + 1)) < 0) PACK_OOO_ERROR
/* Insert the compound members in forward order */
for(i=0; i<PACK_NMEMBS; i++) {
sprintf(name, "%05d", i);
- if(i == sub_cmpd_order) {
- if(H5Tinsert(cmpd, name, 4 * i, sub_cmpd) < 0) TEST_ERROR
+ if(i == 0) {
+ if(H5Tinsert(cmpd, name, 4 * i, sub_cmpd) < 0) PACK_OOO_ERROR
} else
- if(H5Tinsert(cmpd, name, 4 * i, H5T_STD_I32BE) < 0) TEST_ERROR
+ if(H5Tinsert(cmpd, name, 4 * i, H5T_STD_I32BE) < 0) PACK_OOO_ERROR
} /* end for */
/* Verify that the compound is packed */
- if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) TEST_ERROR
- if(!dt->shared->u.compnd.packed) TEST_ERROR
+ if(NULL == (dt = (H5T_t *) H5I_object_verify(cmpd, H5I_DATATYPE))) PACK_OOO_ERROR
+ if(!dt->shared->u.compnd.packed) PACK_OOO_ERROR
/* Close */
- if(H5Tclose(cmpd) < 0) TEST_ERROR
- if(H5Tclose(sub_cmpd) < 0) TEST_ERROR
+ if(H5Tclose(cmpd) < 0) PACK_OOO_ERROR
+ if(H5Tclose(sub_cmpd) < 0) PACK_OOO_ERROR
PASSED();