summaryrefslogtreecommitdiffstats
path: root/test/gen_cross.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-03-25 15:58:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-03-25 15:58:48 (GMT)
commita7d3f5b5b1591c6cbf77b07383fc6de51e11d0b1 (patch)
treeea5b56bde574d082b6f82dd36d307aa7426eb639 /test/gen_cross.c
parent708e8077c2c1bc5c1a28d8804e6a0ee670fe4600 (diff)
downloadhdf5-a7d3f5b5b1591c6cbf77b07383fc6de51e11d0b1.zip
hdf5-a7d3f5b5b1591c6cbf77b07383fc6de51e11d0b1.tar.gz
hdf5-a7d3f5b5b1591c6cbf77b07383fc6de51e11d0b1.tar.bz2
[svn-r24894] Description:
Bring r24869 & r24875 from trunk to 1.8 branch: Clean up more compiler warnings, plus merge a few Coverity bug fixes from the hdf5_1_8_coverity branch back to the trunk: r20877: Purpose: Fix coverity issue 1723 Description: Modified test_generate in hl/test_image to close file "f" before exit, even if an error occurs. r20879: Issue 63: change check of return of H5Tget_nmembers to <=0. No need to go futher if call fails as well as empty. r20881: Coverity #659 in Run 46: I changed the Line 442 where it tries to check whether FLAG_PRINTED is TRUE. But it had just been set to FALSE. I took out the condition check in the print statement. Tested on: Mac OSX/64 10.9.2 (amazon) w/C++, FORTRAN & Parallel (daily tested on trunk)
Diffstat (limited to 'test/gen_cross.c')
-rw-r--r--test/gen_cross.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/gen_cross.c b/test/gen_cross.c
index bdc2835..3b0a56f 100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -24,6 +24,7 @@
* under hdf5/test/ directory.
*/
+#include <stdio.h>
#include "h5test.h"
#define H5FILE_NAME "data.h5"
@@ -70,7 +71,9 @@ int create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid);
int create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid);
int create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
+#ifdef H5_HAVE_FILTER_SZIP
int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
+#endif /* H5_HAVE_FILTER_SZIP */
int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
@@ -1016,6 +1019,7 @@ error:
#endif /* H5_HAVE_FILTER_DEFLATE */
}
+#ifdef H5_HAVE_FILTER_SZIP
/*-------------------------------------------------------------------------
* Function: create_szip_dsets_float
@@ -1035,7 +1039,6 @@ error:
int
create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid)
{
-#ifdef H5_HAVE_FILTER_SZIP
hid_t dataset; /* dataset handles */
hid_t dcpl;
float data[NX][NY]; /* data to write */
@@ -1097,15 +1100,8 @@ create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid)
if(H5Pclose(dcpl) < 0)
TEST_ERROR
-#else /* H5_HAVE_FILTER_SZIP */
- const char *not_supported= "Szip filter is not enabled. Can't create the dataset.";
-
- puts(not_supported);
-#endif /* H5_HAVE_FILTER_SZIP */
-
return 0;
-#ifdef H5_HAVE_FILTER_SZIP
error:
H5E_BEGIN_TRY {
H5Pclose(dcpl);
@@ -1113,8 +1109,8 @@ error:
} H5E_END_TRY;
return -1;
-#endif /* H5_HAVE_FILTER_SZIP */
}
+#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
@@ -1426,9 +1422,13 @@ main (void)
if(create_deflate_dsets_float(file, filespace, memspace) < 0)
{H5_FAILED(); AT(); return 1;}
+#ifdef H5_HAVE_FILTER_SZIP
/* Create a dataset of FLOAT with szip filter */
if(create_szip_dsets_float(file, filespace, memspace) < 0)
{H5_FAILED(); AT(); return 1;}
+#else /* H5_HAVE_FILTER_SZIP */
+ puts("Szip filter is not enabled. Can't create the dataset.");
+#endif /* H5_HAVE_FILTER_SZIP */
/* Create a dataset of FLOAT with shuffle filter */
if(create_shuffle_dsets_float(file, filespace, memspace) < 0)