diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-03-05 04:30:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 04:30:09 (GMT) |
commit | e84e5ee4672e22753a4d3d600dca2d5291953d78 (patch) | |
tree | cd9611a0a8bd16af9b372cd5f610750ca61d081a /test | |
parent | 580008d5bb39e3a9a4a92aefe06dce6941cd485b (diff) | |
download | hdf5-e84e5ee4672e22753a4d3d600dca2d5291953d78.zip hdf5-e84e5ee4672e22753a4d3d600dca2d5291953d78.tar.gz hdf5-e84e5ee4672e22753a4d3d600dca2d5291953d78.tar.bz2 |
Fixes various warnings noticed on Windows (#425)
* Fixes various warnings noticed on Windows
- Adds a prototype for our implementation of vasprintf
- Return type of H5_get_utf16_str() is now non-const
- Fixes possible uninitialized return type in Wremove_utf8
- Better isolation of fork() code in accum.c:test_swmr_write_big()
- Better isolation of non-zlib code in dsets.c:test_filter_delete()
- Removed unused variable in trefer.c:test_reference_cmpnd_obj()
* Fixes clang-format issues
Diffstat (limited to 'test')
-rw-r--r-- | test/accum.c | 25 | ||||
-rw-r--r-- | test/dsets.c | 10 | ||||
-rw-r--r-- | test/trefer.c | 2 |
3 files changed, 18 insertions, 19 deletions
diff --git a/test/accum.c b/test/accum.c index e9542cf..08fe926 100644 --- a/test/accum.c +++ b/test/accum.c @@ -2092,6 +2092,7 @@ error: unsigned test_swmr_write_big(hbool_t newest_format) { +#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ H5F_t * rf = NULL; /* File pointer */ @@ -2099,26 +2100,16 @@ test_swmr_write_big(hbool_t newest_format) uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */ uint8_t wbuf[1024]; /* Buffer for reading & writing */ unsigned u; /* Local index variable */ -#ifdef H5_HAVE_UNISTD_H - pid_t pid; /* Process ID */ -#endif /* H5_HAVE_UNISTD_H */ - int status; /* Status returned from child process */ - char * driver = NULL; /* VFD string (from env variable) */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + pid_t pid; /* Process ID */ + int status; /* Status returned from child process */ + char * driver = NULL; /* VFD string (from env variable) */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (newest_format) TESTING("SWMR write of large metadata: with latest format") else TESTING("SWMR write of large metadata: with non-latest-format") -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) - - SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); - return 0; - -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ - /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ @@ -2296,7 +2287,11 @@ error: return 1; -#endif +#else + SKIPPED(); + HDputs(" Test skipped due to fork, waitpid, or pid_t not defined."); + return 0; +#endif /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) */ } /* end test_swmr_write_big() */ diff --git a/test/dsets.c b/test/dsets.c index 5dcdbce..8600d75 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -6976,6 +6976,7 @@ error: static herr_t test_filter_delete(hid_t file) { +#ifdef H5_HAVE_FILTER_DEFLATE H5Z_filter_t filtn; /* filter identification number */ hid_t dsid = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ @@ -6987,6 +6988,7 @@ test_filter_delete(hid_t file) unsigned flags; /* flags for filter */ herr_t ret; /* generic return value */ int i; +#endif TESTING("filter deletion"); @@ -7088,9 +7090,7 @@ test_filter_delete(hid_t file) goto error; PASSED(); -#else - SKIPPED(); -#endif + return SUCCEED; error: @@ -7103,6 +7103,10 @@ error: } H5E_END_TRY; return FAIL; +#else + SKIPPED(); + return SUCCEED; +#endif } /* end test_filter_delete() */ /*------------------------------------------------------------------------- diff --git a/test/trefer.c b/test/trefer.c index 0d6ae75..6422a1b 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -832,7 +832,7 @@ test_reference_cmpnd_obj(void) hsize_t cmpnd_dims[] = {1}; hid_t dapl_id; /* Dataset access property list */ unsigned * ibuf, *obuf; - unsigned i, j; /* Counters */ + unsigned i; /* Counter */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ s2_t cmpnd_wbuf, cmpnd_rbuf; |