From 27bff24bed117605d31a51d04baa5bbdc6fc02d6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 30 Dec 2004 09:52:52 -0500 Subject: [svn-r9733] Purpose: Bug fix Description: szip tests were failing due to a few "H5_SZIP_CAN_ENCODE" ifdefs still lying around in the source code. Solution: Eliminate compile time testing by using new SZ_encoder_enabled() routine at run time. Platforms tested: FreeBSD 4.10 (sleipnir) w/szip --- test/dsets.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 6731c5d..ead0c43 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -23,6 +23,9 @@ #include #include "h5test.h" +#ifdef H5_HAVE_SZLIB_H +# include "szlib.h" +#endif /* * This file needs to access private datatypes from the H5Z package. @@ -1806,17 +1809,18 @@ test_get_filter_info(void) #endif #ifdef H5_HAVE_FILTER_SZIP - if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - -#ifdef H5_SZIP_CAN_ENCODE - if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || - ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) - TEST_ERROR -#else - if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) || - ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) - TEST_ERROR -#endif /* H5_SZIP_CAN_ENCODE */ + if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR + + if(SZ_encoder_enabled()) { + if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || + ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) + TEST_ERROR + } /* end if */ + else { + if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) || + ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) + TEST_ERROR + } /* end else */ #endif /* H5_HAVE_FILTER_SZIP */ /* Verify that get_filter_info doesn't throw an error when given a bad filter */ -- cgit v0.12