From a56a1205d25b9184d628a30886ed4a0801d3ec94 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 30 Dec 2004 09:52:51 -0500 Subject: [svn-r9732] 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 802fc87..afce193 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. @@ -1797,17 +1800,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 throws an error when given a bad filter */ -- cgit v0.12