summaryrefslogtreecommitdiffstats
path: root/test/objcopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/objcopy.c')
-rw-r--r--test/objcopy.c151
1 files changed, 57 insertions, 94 deletions
diff --git a/test/objcopy.c b/test/objcopy.c
index 1f89e16..05ddfa4 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -284,8 +284,6 @@ addr_reset(void)
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -345,8 +343,6 @@ error:
* Programmer: Peter Cao
* Monday, March 5, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -422,8 +418,6 @@ error:
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -517,8 +511,6 @@ error:
* Programmer: Peter Cao
* Saturday, December 17, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -579,8 +571,6 @@ done:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -602,7 +592,7 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id)
goto done;
for(u = 0; u < num_attributes_g; u++) {
- sprintf(attr_name, "%u attr", u);
+ HDsprintf(attr_name, "%u attr", u);
/* Set attribute data */
attr_data[0] = (int)(100 * u);
@@ -671,7 +661,7 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id)
if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) goto done;
for(u = 0; u < num_attributes_g; u++) {
- sprintf(attr_name, "%u attr", u);
+ HDsprintf(attr_name, "%u attr", u);
/* Set attribute data */
attr_data[0] = (int)(100 * u);
@@ -856,10 +846,6 @@ error:
* Note: This isn't very general, the attributes are assumed to be
* those written in test_copy_attach_attributes().
*
- * Modifier: Peter Cao
- * Wednesday, March 21, 2007
- * Change to compare any attributes of two objects
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1094,6 +1080,9 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if(H5Tequal(obj1_id, obj2_id) != TRUE) TEST_ERROR
break;
+ case H5O_TYPE_MAP:
+ /* Maps not supported in native VOL connector */
+
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
@@ -1152,6 +1141,9 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if(H5Tequal(obj1_id, obj2_id) != TRUE) TEST_ERROR
break;
+ case H5O_TYPE_MAP:
+ /* Maps not supported in native VOL connector */
+
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
@@ -1167,7 +1159,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if((obj2_sid = H5Rget_region(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
/* Check if dataspaces are the same shape */
- if(H5S__select_shape_same_test(obj1_sid, obj2_sid) < 0) TEST_ERROR
+ if(H5Sselect_shape_same(obj1_sid, obj2_sid) < 0) TEST_ERROR
/* Close dataspaces */
if(H5Sclose(obj1_sid) < 0) TEST_ERROR
@@ -1213,8 +1205,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
hssize_t nelmts; /* # of elements in dataspace */
void *rbuf = NULL; /* Buffer for reading raw data */
void *rbuf2 = NULL; /* Buffer for reading raw data */
- H5D_space_status_t space_status; /* Dataset's raw data space status */
- H5D_space_status_t space_status2; /* Dataset's raw data space status */
+ H5D_space_status_t space_status; /* Dataset's raw dataspace status */
+ H5D_space_status_t space_status2; /* Dataset's raw dataspace status */
/* Check the datatypes are equal */
@@ -1468,10 +1460,13 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
if(H5Tequal(oid, oid2) != TRUE) TEST_ERROR
break;
+ case H5O_TYPE_MAP:
+ HDassert(0 && "maps not supported in native VOL connector");
+
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
-HDassert(0 && "Unknown type of object");
+ HDassert(0 && "Unknown type of object");
break;
} /* end switch */
@@ -1569,8 +1564,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1858,8 +1851,6 @@ error:
* Programmer: Neil
* Friday, March 11, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1999,8 +1990,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2294,8 +2283,6 @@ error:
* Programmer: Neil Fortner
* Thursday, January 15, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2519,8 +2506,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2651,8 +2636,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4396,8 +4379,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6281,8 +6262,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6376,8 +6355,6 @@ error:
* Programmer: Peter Cao
* August 8, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6509,8 +6486,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6692,15 +6667,15 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
/* create nested sub-groups & datasets */
for(i = 0; i < NUM_SUB_GROUPS; i++) {
- sprintf(objname, "Group #%d", i);
+ HDsprintf(objname, "Group #%d", i);
if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(j = 0; j < NUM_SUB_GROUPS; j++) {
- sprintf(objname, "Group #%d", j);
+ HDsprintf(objname, "Group #%d", j);
if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(k = 0; k < NUM_DATASETS; k++) {
- sprintf(objname, "Dataset #%d", k);
+ HDsprintf(objname, "Dataset #%d", k);
/* add a dataset to the group */
if((did = H5Dcreate2(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -6933,11 +6908,11 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create wide sub-group hierarchy, with multiple links to higher groups */
for(u = 0; u < NUM_WIDE_LOOP_GROUPS; u++) {
- sprintf(objname, "%s-%u", NAME_GROUP_SUB, u);
+ HDsprintf(objname, "%s-%u", NAME_GROUP_SUB, u);
if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(v = 0; v < NUM_WIDE_LOOP_GROUPS; v++) {
- sprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v);
+ HDsprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v);
if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create link to top group */
@@ -7024,12 +6999,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- * Neil Fortner
- * Tuesday, February 16, 2010
- * Modified test to test flags for expanding soft and external
- * links.
- *
*-------------------------------------------------------------------------
*/
static int
@@ -8017,7 +7986,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set compact plist */
@@ -8171,7 +8140,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -8326,7 +8295,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -8487,7 +8456,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -10289,7 +10258,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src1, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10313,7 +10282,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src2, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10524,7 +10493,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@@ -10551,7 +10520,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@@ -10796,7 +10765,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10823,7 +10792,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -10832,7 +10801,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -11027,7 +10996,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -11057,7 +11026,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* create anonymous committed data type */
+ /* create anonymous committed datatype */
if((H5Tcommit_anon(fid_dst, tid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create attribute at SRC file */
@@ -12817,7 +12786,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -12847,7 +12816,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -12856,7 +12825,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13176,7 +13145,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -13206,7 +13175,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13215,7 +13184,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13499,8 +13468,6 @@ error:
* Programmer: Peter Cao
* March 11, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -13817,8 +13784,6 @@ error:
* Programmer: Vailin Choi
* Feb 7, 2012
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -14125,7 +14090,7 @@ error:
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose: Test H5Ocopy()
*
@@ -14133,13 +14098,11 @@ error:
* new or old format, messages can be shared in either,
* both, or neither of the source and destination files.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -14159,7 +14122,7 @@ main(void)
ExpressMode = GetTestExpress();
if (ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Copy the file access property list */
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
@@ -14195,52 +14158,52 @@ main(void)
/* Test with and without shared messages */
if(configuration & CONFIG_SHARE_SRC) {
- puts("\nTesting with shared src messages:");
+ HDputs("\nTesting with shared src messages:");
fcpl_src = fcpl_shared;
}
else {
- puts("\nTesting without shared src messages:");
+ HDputs("\nTesting without shared src messages:");
fcpl_src = H5P_DEFAULT;
}
if(configuration & CONFIG_SHARE_DST) {
- puts("Testing with shared dst messages:");
+ HDputs("Testing with shared dst messages:");
fcpl_dst = fcpl_shared;
same_file = FALSE;
}
else {
- puts("Testing without shared dst messages:");
+ HDputs("Testing without shared dst messages:");
fcpl_dst = H5P_DEFAULT;
}
/* Set the FAPL for the source file's type of format */
if(configuration & CONFIG_SRC_NEW_FORMAT) {
- puts("Testing with latest format for source file:");
+ HDputs("Testing with latest format for source file:");
src_fapl = fapl2;
/* Test with and without dense attributes */
if(configuration & CONFIG_DENSE) {
- puts("Testing with dense attributes:");
+ HDputs("Testing with dense attributes:");
num_attributes_g = max_compact + 1;
}
else {
- puts("Testing without dense attributes:");
+ HDputs("Testing without dense attributes:");
num_attributes_g = MAX(min_dense, 2) - 2;
}
} /* end if */
else {
- puts("Testing with oldest file format for source file:");
+ HDputs("Testing with oldest file format for source file:");
src_fapl = fapl;
num_attributes_g = 4;
} /* end else */
/* Set the FAPL for the destination file's type of format */
if(configuration & CONFIG_DST_NEW_FORMAT) {
- puts("Testing with latest format for destination file:");
+ HDputs("Testing with latest format for destination file:");
dst_fapl = fapl2;
same_file = FALSE;
} /* end if */
else {
- puts("Testing with oldest file format for destination file:");
+ HDputs("Testing with oldest file format for destination file:");
dst_fapl = fapl;
} /* end else */
@@ -14411,12 +14374,12 @@ main(void)
/* Results */
if(nerrors) {
- printf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
+ HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
nerrors, (1 == nerrors ? "" : "S"));
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
} /* end if */
- puts ("All object copying tests passed.");
+ HDputs ("All object copying tests passed.");
/* close property list.
* NOTE: if this property list is not closed and the test is
@@ -14443,9 +14406,9 @@ main(void)
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- return 1;
+ HDexit(EXIT_FAILURE);
} /* main */