summaryrefslogtreecommitdiffstats
path: root/test/objcopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/objcopy.c')
-rwxr-xr-xtest/objcopy.c247
1 files changed, 202 insertions, 45 deletions
diff --git a/test/objcopy.c b/test/objcopy.c
index 61963b5..c2d71c0 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -73,6 +73,7 @@ const char *FILENAME[] = {
#define NAME_DATASET_SIMPLE2 "dataset_simple_copy"
#define NAME_DATASET_COMPOUND "dataset_compound"
#define NAME_DATASET_CHUNKED "dataset_chunked"
+#define NAME_DATASET_CHUNKED2 "dataset_chunked2"
#define NAME_DATASET_COMPACT "dataset_compact"
#define NAME_DATASET_EXTERNAL "dataset_ext"
#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype"
@@ -117,7 +118,7 @@ const char *FILENAME[] = {
char src_obj_full_name[215]; /* the full path + name of the object to be copied */
-int num_attributes_g; /* Number of attributes created */
+unsigned num_attributes_g; /* Number of attributes created */
/* Table containing object id and object name */
/* (Used for detecting duplicate objects when comparing groups */
@@ -531,19 +532,20 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id)
{
hid_t aid = -1, sid = -1;
char attr_name[ATTR_NAME_LEN];
- int attr_data[2], i = 0;
+ int attr_data[2];
hsize_t dim1 = 2;
+ unsigned u;
int ret_value = -1;
if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 )
goto done;
- for (i=0; i<num_attributes_g; i++) {
- sprintf(attr_name, "%d attr", i);
+ for(u = 0; u < num_attributes_g; u++) {
+ sprintf(attr_name, "%u attr", u);
/* Set attribute data */
- attr_data[0] = 100 * i;
- attr_data[1] = 200 * i;
+ attr_data[0] = (int)(100 * u);
+ attr_data[1] = (int)(200 * u);
if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto done;
@@ -586,17 +588,18 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id)
{
hid_t aid = -1, sid = -1;
char attr_name[ATTR_NAME_LEN];
- int attr_data[2], i;
+ int attr_data[2];
+ unsigned u;
hsize_t dim1 = 2;
if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) goto done;
- for (i=0; i<num_attributes_g; i++) {
- sprintf(attr_name, "%d attr", i);
+ for(u = 0; u < num_attributes_g; u++) {
+ sprintf(attr_name, "%u attr", u);
/* Set attribute data */
- attr_data[0] = 100 * i;
- attr_data[1] = 200 * i;
+ attr_data[0] = (int)(100 * u);
+ attr_data[1] = (int)(200 * u);
/* Add attribute to first object */
if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done;
@@ -1797,7 +1800,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl, int config)
+test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl)
{
hid_t fid = -1; /* File ID */
hid_t sid = -1; /* Dataspace ID */
@@ -2147,9 +2150,13 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hsize_t dim1d[1]; /* Dataset dimensions */
+ hsize_t max_dim1d[1]; /* Dataset max. dimensions */
hsize_t dim2d[2]; /* Dataset dimensions */
+ hsize_t chunk_dim1d[1] ={CHUNK_SIZE_1}; /* Chunk dimensions */
hsize_t chunk_dim2d[2] ={CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */
- float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
+ float buf1d[DIM_SIZE_1]; /* Buffer for writing data */
+ float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
int i, j; /* Local index variables */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
@@ -2157,9 +2164,11 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
TESTING("H5Ocopy(): chunked dataset");
/* set initial data values */
- for (i=0; i<DIM_SIZE_1; i++)
- for (j=0; j<DIM_SIZE_2; j++)
- buf[i][j] = (float)(i+j/100.0);
+ for(i = 0; i < DIM_SIZE_1; i++) {
+ buf1d[i] = (float)(i / 2.0);
+ for(j = 0; j < DIM_SIZE_2; j++)
+ buf2d[i][j] = (float)(i + (j / 100.0));
+ } /* end for */
/* Initialize the filenames */
h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename);
@@ -2171,11 +2180,40 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR
- /* Set dataspace dimensions */
- dim2d[0]=DIM_SIZE_1;
- dim2d[1]=DIM_SIZE_2;
+ /* Set 1-D dataspace dimensions */
+ dim1d[0] = DIM_SIZE_1;
+ max_dim1d[0] = H5S_UNLIMITED;
- /* create dataspace */
+ /* create 1-D dataspace */
+ if((sid = H5Screate_simple(1, dim1d, max_dim1d)) < 0) TEST_ERROR
+
+ /* create and set chunk plist */
+ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
+
+ /* create dataset */
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* close chunk plist */
+ if(H5Pclose(pid) < 0) TEST_ERROR
+
+ /* write data into file */
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1d) < 0) TEST_ERROR
+
+ /* close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* attach attributes to the dataset */
+ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
+
+ /* close the dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Set 2-D dataspace dimensions */
+ dim2d[0] = DIM_SIZE_1;
+ dim2d[1] = DIM_SIZE_2;
+
+ /* create 2-D dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -2183,13 +2221,13 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED2, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
/* write data into file */
- if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2d) < 0) TEST_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -2213,17 +2251,33 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* copy the dataset from SRC to DST */
+ /* copy the datasets from SRC to DST */
if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED2, fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* open the dataset for copy */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
- /* open the destination dataset */
+ /* open the 1-D destination dataset */
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check if the datasets are equal */
- if(compare_datasets(did, did2, H5P_DEFAULT, buf) != TRUE) TEST_ERROR
+ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR
+
+ /* close the destination dataset */
+ if(H5Dclose(did2) < 0) TEST_ERROR
+
+ /* close the source dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* open the 2-D dataset for copy */
+ if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* open the destination dataset */
+ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check if the datasets are equal */
+ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
/* close the destination dataset */
if(H5Dclose(did2) < 0) TEST_ERROR
@@ -2274,7 +2328,10 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hsize_t dim1d[1]; /* Dataset dimensions */
+ hsize_t max_dim1d[1]; /* Dataset max. dimensions */
hsize_t dim2d[2]; /* Dataset dimensions */
+ hsize_t chunk_dim1d[1] ={CHUNK_SIZE_1}; /* Chunk dimensions */
hsize_t chunk_dim2d[2] ={CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
@@ -2291,11 +2348,37 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR
- /* Set dataspace dimensions */
- dim2d[0]=DIM_SIZE_1;
- dim2d[1]=DIM_SIZE_2;
+ /* Set 1-D dataspace dimensions */
+ dim1d[0] = DIM_SIZE_1;
+ max_dim1d[0] = H5S_UNLIMITED;
- /* create dataspace */
+ /* create 1-D dataspace */
+ if((sid = H5Screate_simple(1, dim1d, max_dim1d)) < 0) TEST_ERROR
+
+ /* create and set chunk plist */
+ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
+
+ /* create dataset */
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* close chunk plist */
+ if(H5Pclose(pid) < 0) TEST_ERROR
+
+ /* close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* attach attributes to the dataset */
+ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
+
+ /* close the dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Set 2-D dataspace dimensions */
+ dim2d[0] = DIM_SIZE_1;
+ dim2d[1] = DIM_SIZE_2;
+
+ /* create 2-D dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -2303,7 +2386,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED2, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2330,8 +2413,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* copy the dataset from SRC to DST */
+ /* copy the datasets from SRC to DST */
if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED2, fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* open the dataset for copy */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2348,6 +2432,21 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* close the source dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+ /* open the dataset for copy */
+ if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* open the destination dataset */
+ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check if the datasets are equal */
+ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
+
+ /* close the destination dataset */
+ if(H5Dclose(did2) < 0) TEST_ERROR
+
+ /* close the source dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
@@ -2391,11 +2490,16 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hsize_t dim1d[1]; /* Dataset dimensions */
+ hsize_t new_dim1d[1]; /* Dataset dimensions */
+ hsize_t max_dim1d[1]; /* Dataset max. dimensions */
hsize_t dim2d[2]; /* Dataset dimensions */
hsize_t new_dim2d[2]; /* Dataset dimensions */
hsize_t max_dim2d[2]; /* Dataset max. dimensions */
- hsize_t chunk_dim2d[2] ={CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */
- float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
+ hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */
+ hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */
+ float buf1d[DIM_SIZE_1]; /* Buffer for writing data */
+ float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
int i, j; /* Local index variables */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
@@ -2403,9 +2507,11 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
TESTING("H5Ocopy(): sparse dataset");
/* set initial data values */
- for (i=0; i<DIM_SIZE_1; i++)
- for (j=0; j<DIM_SIZE_2; j++)
- buf[i][j] = (float)(i+j/100.0);
+ for(i = 0; i < DIM_SIZE_1; i++) {
+ buf1d[i] = (float)(i / 10.0);
+ for(j = 0; j < DIM_SIZE_2; j++)
+ buf2d[i][j] = (float)(i + (j / 100.0));
+ } /* end for */
/* Initialize the filenames */
h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename);
@@ -2417,13 +2523,48 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR
- /* Set dataspace dimensions */
+ /* Set 1-D dataspace dimensions */
+ dim1d[0]=DIM_SIZE_1;
+ max_dim1d[0]=H5S_UNLIMITED;
+
+ /* create 1-D dataspace */
+ if((sid = H5Screate_simple(1, dim1d, max_dim1d)) < 0) TEST_ERROR
+
+ /* create and set chunk plist */
+ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
+
+ /* create dataset */
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* close chunk plist */
+ if(H5Pclose(pid) < 0) TEST_ERROR
+
+ /* write data into file */
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1d) < 0) TEST_ERROR
+
+ /* close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* Set extended dataset dimensions */
+ new_dim1d[0] = DIM_SIZE_1 * 2;
+
+ /* Extend dataset's dimensions */
+ if(H5Dset_extent(did, new_dim1d) < 0) TEST_ERROR
+
+ /* attach attributes to the dataset */
+ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
+
+ /* close the dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Set 2-D dataspace dimensions */
dim2d[0]=DIM_SIZE_1;
dim2d[1]=DIM_SIZE_2;
max_dim2d[0]=H5S_UNLIMITED;
max_dim2d[1]=H5S_UNLIMITED;
- /* create dataspace */
+ /* create 2-D dataspace */
if((sid = H5Screate_simple(2, dim2d, max_dim2d)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -2431,13 +2572,16 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED2, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
/* write data into file */
- if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2d) < 0) TEST_ERROR
+
+ /* close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
/* Set extended dataset dimensions */
new_dim2d[0] = DIM_SIZE_1 * 2;
@@ -2446,9 +2590,6 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* Extend dataset's dimensions */
if(H5Dset_extent(did, new_dim2d) < 0) TEST_ERROR
- /* close dataspace */
- if(H5Sclose(sid) < 0) TEST_ERROR
-
/* attach attributes to the dataset */
if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
@@ -2468,8 +2609,9 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* copy the dataset from SRC to DST */
+ /* copy the datasets from SRC to DST */
if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED2, fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* open the dataset for copy */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2486,6 +2628,21 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
/* close the source dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+ /* open the dataset for copy */
+ if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* open the destination dataset */
+ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check if the datasets are equal */
+ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
+
+ /* close the destination dataset */
+ if(H5Dclose(did2) < 0) TEST_ERROR
+
+ /* close the source dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
@@ -7334,7 +7491,7 @@ main(void)
/* The tests... */
nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, my_fapl);
- nerrors += test_copy_dataset_simple_samefile(fcpl_src, my_fapl, configuration);
+ nerrors += test_copy_dataset_simple_samefile(fcpl_src, my_fapl);
nerrors += test_copy_dataset_simple_empty(fcpl_src, fcpl_dst, my_fapl);
nerrors += test_copy_dataset_compound(fcpl_src, fcpl_dst, my_fapl);
nerrors += test_copy_dataset_chunked(fcpl_src, fcpl_dst, my_fapl);