summaryrefslogtreecommitdiffstats
path: root/test/gen_cross.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-03-23 06:27:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-03-23 06:27:57 (GMT)
commitf97d63cb95fa2595e5137a7ac6e0d1282fb5118b (patch)
tree698d5f3e535b8f77e4ecfb2da9722ab0cb040386 /test/gen_cross.c
parent67be45610fd450909038afea54f79e6a91c458cf (diff)
downloadhdf5-f97d63cb95fa2595e5137a7ac6e0d1282fb5118b.zip
hdf5-f97d63cb95fa2595e5137a7ac6e0d1282fb5118b.tar.gz
hdf5-f97d63cb95fa2595e5137a7ac6e0d1282fb5118b.tar.bz2
[svn-r24869] Description:
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 (too minor to require h5committest)
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)