summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/testh5repack_main.c
diff options
context:
space:
mode:
authorRobert E. McGrath <mcgrath@ncsa.uiuc.edu>2004-11-02 19:14:14 (GMT)
committerRobert E. McGrath <mcgrath@ncsa.uiuc.edu>2004-11-02 19:14:14 (GMT)
commit25c1e28ffd660e713f97b65e70620c7128f46f1f (patch)
treead6abf34988df6351d4b579a7b87be6f822ca247 /tools/h5repack/testh5repack_main.c
parent8c0c4f945db726fcddd2a40e4f617cdf6aac6be8 (diff)
downloadhdf5-25c1e28ffd660e713f97b65e70620c7128f46f1f.zip
hdf5-25c1e28ffd660e713f97b65e70620c7128f46f1f.tar.gz
hdf5-25c1e28ffd660e713f97b65e70620c7128f46f1f.tar.bz2
[svn-r9496] Purpose:
Fix SZIP filter to dynmically detect encoder. Description: Solution: See: http://hdf.ncsa.uiuc.edu/RFC/SZIP/Szip_dynamic_12_Oct.pdf Changes to h5repack tests, contingent on detecting SZIP encoder. Note new program: testh5repack_detect_szip Checks fo rencoder, prints out "yes" or "no". Used by hrepack.sh to detect encoder. Can also be used for windows tests. This is only used as part of the tests. Had to modify Makefile to build and clean this program.
Diffstat (limited to 'tools/h5repack/testh5repack_main.c')
-rw-r--r--tools/h5repack/testh5repack_main.c46
1 files changed, 39 insertions, 7 deletions
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index caa4ac9..6729174 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -40,6 +40,9 @@ int main (void)
{
pack_opt_t pack_options;
diff_opt_t diff_options;
+#if defined (H5_HAVE_FILTER_SZIP)
+ int szip_can_encode = 0;
+#endif
memset(&diff_options, 0, sizeof (diff_opt_t));
memset(&pack_options, 0, sizeof (pack_opt_t));
@@ -229,13 +232,17 @@ int main (void)
TESTING(" adding szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ szip_can_encode = 1;
+}
/*-------------------------------------------------------------------------
* test an individual object option
*-------------------------------------------------------------------------
*/
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options)<0)
@@ -252,6 +259,9 @@ int main (void)
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -263,7 +273,8 @@ int main (void)
*/
TESTING(" adding szip filter to all");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("SZIP=8,NN",&pack_options)<0)
@@ -278,6 +289,9 @@ TESTING(" adding szip filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -425,9 +439,11 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
#endif
-#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options)<0)
TEST_ERROR;
+}
#endif
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -765,7 +781,8 @@ TESTING(" addding shuffle filter to all");
TESTING(" copy of szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack(FNAME7,FNAME7OUT,&pack_options)<0)
@@ -778,13 +795,17 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
TESTING(" removing szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_szip:NONE",&pack_options)<0)
@@ -799,6 +820,9 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -941,10 +965,11 @@ TESTING(" addding shuffle filter to all");
TESTING(" filter conversion from deflate to szip");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) \
+#if defined (H5_HAVE_FILTER_SZIP) \
&& defined (H5_HAVE_FILTER_DEFLATE) \
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options)<0)
@@ -959,16 +984,20 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
TESTING(" filter conversion from szip to deflate");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) \
+#if defined (H5_HAVE_FILTER_SZIP) \
&& defined (H5_HAVE_FILTER_DEFLATE) \
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0)
@@ -983,6 +1012,9 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif