diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-17 12:48:04 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-17 12:48:04 (GMT) |
commit | 13c484162cc9098e6538deec931563848011bdb5 (patch) | |
tree | c33201bfab0f74c7e3bff9b17a55d92deb852118 /test | |
parent | be729e5f78ae9308dd4a305039e8ddd58068d477 (diff) | |
download | hdf5-13c484162cc9098e6538deec931563848011bdb5.zip hdf5-13c484162cc9098e6538deec931563848011bdb5.tar.gz hdf5-13c484162cc9098e6538deec931563848011bdb5.tar.bz2 |
[svn-r14206] Description:
Make H5Pget_filter API versioned and switch internal usage to
H5Pget_filter2.
Add regression test for H5Pget_filter1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 20 | ||||
-rw-r--r-- | test/tsohm.c | 66 |
2 files changed, 48 insertions, 38 deletions
diff --git a/test/dsets.c b/test/dsets.c index 8125d75..68fe47f 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5545,11 +5545,7 @@ test_filter_delete(hid_t file) /* check if filter was deleted */ for(i=0; i<nfilters; i++) { -#ifdef H5_WANT_H5_V1_6_COMPAT - filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL); -#else - filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL, NULL); -#endif + filtn = H5Pget_filter2(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL, NULL); if(H5Z_FILTER_DEFLATE==filtn) goto error; } @@ -6281,6 +6277,20 @@ test_deprec(hid_t file) create_parms = H5Pcreate(H5P_DATASET_CREATE); assert(create_parms >= 0); + /* Add the deflate filter, if available */ +#if defined H5_HAVE_FILTER_DEFLATE +{ + H5Z_filter_t filtn; /* filter identification number */ + + if(H5Pset_deflate(create_parms, 6) < 0) goto error; + + /* Check for the deflate filter */ + filtn = H5Pget_filter1(create_parms, (unsigned)0, NULL, NULL, NULL, (size_t)0, NULL); + if(H5Z_FILTER_DEFLATE!=filtn) + goto error; +} +#endif /* H5_HAVE_FILTER_DEFLATE */ + /* Attempt to create a dataset with invalid chunk sizes */ csize[0] = dims[0]*2; csize[1] = dims[1]*2; diff --git a/test/tsohm.c b/test/tsohm.c index e99a1f1..94ffe11 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -1199,25 +1199,25 @@ static void size2_verify_plist1(hid_t plist) /* Hardcoded to correspond to dcpl1_id created in size2_helper */ /* Check filters */ cd_nelmts = 1; - filter = H5Pget_filter(plist, 0, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_SHUFFLE, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 0, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_SHUFFLE, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 1, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 1, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 1, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 1, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 2, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_SHUFFLE, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 2, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_SHUFFLE, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 3, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_FLETCHER32, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 3, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_FLETCHER32, "H5Pget_filter2"); /* Check fill value */ @@ -1258,34 +1258,34 @@ static void size2_verify_plist2(hid_t plist) /* Hardcoded to correspond to dcpl1_id created in size2_helper */ /* Check filters */ cd_nelmts = 1; - filter = H5Pget_filter(plist, 0, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 1, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 0, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 1, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 1, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 2, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 1, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 2, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 2, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 2, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 2, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 2, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 3, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 1, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 3, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 1, "H5Pget_filter2"); cd_nelmts = 1; - filter = H5Pget_filter(plist, 4, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); - CHECK_I(filter, "H5Pget_filter"); - VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter"); - VERIFY(cd_value, 5, "H5Pget_filter"); + filter = H5Pget_filter2(plist, 4, NULL, &cd_nelmts, &cd_value, NAME_BUF_SIZE, name, NULL); + CHECK_I(filter, "H5Pget_filter2"); + VERIFY(filter, H5Z_FILTER_DEFLATE, "H5Pget_filter2"); + VERIFY(cd_value, 5, "H5Pget_filter2"); /* Check fill value */ |