From 7b895e1dd8c9fdba0d94bf4100a1be77ee05a64b Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 10 Jan 2013 11:04:09 -0500 Subject: [svn-r23149] I put more condition checks with macro when DEFLATE filter is disabled. Tested on koala. --- hl/test/test_dset_opt.c | 7 ++++--- perform/dectris_perf.c | 20 +++++++++++++++++++- test/dectris_tst.c | 18 +++++++++++++++++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index a585292..9a0ffb0 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -90,6 +90,7 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ * *------------------------------------------------------------------------- */ +#ifdef H5_HAVE_FILTER_DEFLATE static int test_direct_chunk_write (hid_t file) { @@ -332,6 +333,7 @@ error: return 1; } +#endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- * Function: test_skip_compress_write1 @@ -499,7 +501,7 @@ filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts, size_t *buf_size, void **buf) { int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + ssize_t buf_left=*buf_size; /* Amount of data buffer left to process */ if(flags & H5Z_FLAG_REVERSE) { /* read */ /* Substract the "add on" value to all the data values */ @@ -536,7 +538,7 @@ filter_bogus2(unsigned int flags, size_t UNUSED cd_nelmts, size_t *buf_size, void **buf) { int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + ssize_t buf_left=*buf_size; /* Amount of data buffer left to process */ if(flags & H5Z_FLAG_REVERSE) { /* read */ /* Substract the "add on" value to all the data values */ @@ -948,7 +950,6 @@ test_invalid_parameters(hid_t file) unsigned filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; - int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); int aggression = 9; /* Compression aggression setting */ diff --git a/perform/dectris_perf.c b/perform/dectris_perf.c index 71f818a..509fd24 100644 --- a/perform/dectris_perf.c +++ b/perform/dectris_perf.c @@ -20,7 +20,6 @@ #include "hdf5.h" #include "H5private.h" -#include #include #include #include @@ -29,7 +28,17 @@ #include #include #include + +#ifdef H5_HAVE_FILTER_DEFLATE + +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +# define H5_ZLIB_HEADER "zlib.h" +#endif +#if defined(H5_ZLIB_HEADER) +# include H5_ZLIB_HEADER /* "zlib.h" */ +#endif + const char *FILENAME[] = { "dectris_perf", "unix.raw", @@ -637,3 +646,12 @@ main (void) h5_cleanup(FILENAME, fapl); return 0; } +#else +int +main (void) +{ + printf("Skipped because DEFLATE filter is disabled"); + return 0; +} +#endif /* H5_HAVE_FILTER_DEFLATE */ + diff --git a/test/dectris_tst.c b/test/dectris_tst.c index ec1c23a..2dd6354 100644 --- a/test/dectris_tst.c +++ b/test/dectris_tst.c @@ -19,10 +19,18 @@ */ #include "h5test.h" -#include #include #include +#ifdef H5_HAVE_FILTER_DEFLATE + +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +# define H5_ZLIB_HEADER "zlib.h" +#endif +#if defined(H5_ZLIB_HEADER) +# include H5_ZLIB_HEADER /* "zlib.h" */ +#endif + const char *FILENAME[] = { "dectris", NULL @@ -308,3 +316,11 @@ error: return 1; } +#else +int +main(void) +{ + TESTING("Skipped because DEFLATE filter is disabled"); + return 0; +} +#endif /* H5_HAVE_FILTER_DEFLATE */ -- cgit v0.12