diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-12-21 16:05:00 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-12-21 16:05:00 (GMT) |
commit | e3fe4f7790d6289c8736a20736448d86686751fa (patch) | |
tree | 67c18bfc9018cd4ef494d0ac2401d2d9de1219e5 /test/tmisc.c | |
parent | 56dae018e20d1810137e61564c4ca47da3d32937 (diff) | |
download | hdf5-e3fe4f7790d6289c8736a20736448d86686751fa.zip hdf5-e3fe4f7790d6289c8736a20736448d86686751fa.tar.gz hdf5-e3fe4f7790d6289c8736a20736448d86686751fa.tar.bz2 |
[svn-r13085] Yesterday's checkin wasn't a complete fix for copying filters in DCPLs.
Extended the test so it broke again and then fixed it again.
Tested on kagiso.
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index 20489fe..0f71f8d 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -287,6 +287,7 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC25A_ATTR3_LEN 1 #define MISC25B_FILE "mergemsg.h5" #define MISC25B_GROUP "grp1" +#define MISC26_FILE "dcpl_file" /**************************************************************** ** @@ -4650,17 +4651,23 @@ test_misc25b(void) static void test_misc26(void) { - hid_t dcpl1, dcpl2; /* Property List IDs */ + hid_t fid; /* File ID */ + hid_t sid; /* Dataspace ID */ + hid_t did; /* Dataset ID */ + hid_t dcpl1, dcpl2, dcpl3; /* Property List IDs */ + hsize_t dims[] = {1}; herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Copying filter pipelines\n")); - /* Create the property list */ + /* Create the property list. It needs chunking so we can add filters */ dcpl1 = H5Pcreate(H5P_DATASET_CREATE); CHECK_I(dcpl1, "H5Pcreate"); + ret = H5Pset_chunk(dcpl1, 1, dims); + CHECK_I(ret, "H5Pset_chunk"); - /* Add a filter to the property list */ + /* Add a filter with a data value to the property list */ ret = H5Pset_deflate(dcpl1, 1); CHECK_I(ret, "H5Pset_deflate"); @@ -4668,18 +4675,56 @@ test_misc26(void) dcpl2 = H5Pcopy(dcpl1); CHECK_I(dcpl2, "H5Pcopy"); - /* Add a filter to the copy */ + /* Add a filter with no data values to the copy */ ret = H5Pset_shuffle(dcpl2); CHECK_I(ret, "H5Pset_shuffle"); - /* Close the property lists. If adding the second filter to - * dcpl2 caused it to be in an inconsistent state, closing it - * will trip an assert. + /* Copy the copy */ + dcpl3 = H5Pcopy(dcpl2); + CHECK_I(dcpl3, "H5Pcopy"); + + /* Add another filter */ + ret = H5Pset_deflate(dcpl3, 2); + CHECK_I(ret, "H5Pset_deflate"); + + + /* Create a new file and datasets within that file that use these + * property lists */ + fid = H5Fcreate(MISC26_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fcreate"); + + sid = H5Screate_simple(1, dims, dims); + CHECK(sid, FAIL, "H5Screate_simple"); + + did = H5Dcreate(fid, "dataset1", H5T_NATIVE_FLOAT, sid, dcpl1); + CHECK(did, FAIL, "H5Dcreate"); + ret = H5Dclose(did); + CHECK_I(ret, "H5Dclose"); + + did = H5Dcreate(fid, "dataset2", H5T_NATIVE_FLOAT, sid, dcpl2); + CHECK(did, FAIL, "H5Dcreate"); + ret = H5Dclose(did); + CHECK_I(ret, "H5Dclose"); + + did = H5Dcreate(fid, "dataset3", H5T_NATIVE_FLOAT, sid, dcpl3); + CHECK(did, FAIL, "H5Dcreate"); + ret = H5Dclose(did); + CHECK_I(ret, "H5Dclose"); + + /* Close the dataspace and file */ + ret = H5Sclose(sid); + CHECK_I(ret, "H5Sclose"); + ret = H5Fclose(fid); + CHECK_I(ret, "H5Fclose"); + + /* Close the property lists. */ ret = H5Pclose(dcpl1); CHECK_I(ret, "H5Pclose"); ret = H5Pclose(dcpl2); CHECK_I(ret, "H5Pclose"); + ret = H5Pclose(dcpl3); + CHECK_I(ret, "H5Pclose"); } /**************************************************************** @@ -4774,5 +4819,6 @@ cleanup_misc(void) HDremove(MISC23_FILE); HDremove(MISC24_FILE); HDremove(MISC25A_FILE); + HDremove(MISC26_FILE); } |