summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2019-12-09 18:16:52 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2019-12-09 18:16:52 (GMT)
commit49fe497201bcefcd9beb01fe8fc2175974b73799 (patch)
tree82ec36c32198122e75c1dfa20e61678b8722f56b /test
parent62e6349eabb00c69fa69aab0fbe34cdc092d072f (diff)
downloadhdf5-49fe497201bcefcd9beb01fe8fc2175974b73799.zip
hdf5-49fe497201bcefcd9beb01fe8fc2175974b73799.tar.gz
hdf5-49fe497201bcefcd9beb01fe8fc2175974b73799.tar.bz2
Revert "Merge branch 'hdf5_1_12' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into hdf5_1_12"
This reverts commit 9f9336a5bd541752f472bab4c93da8de89f862cd, reversing changes made to 437a1919e7ba60fe75a33a466d264183a0255319.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/H5srcdir.c61
-rw-r--r--test/H5srcdir.h39
-rw-r--r--test/H5srcdir_str.h.in2
-rw-r--r--test/Makefile.am8
-rw-r--r--test/accum.c8
-rw-r--r--test/cache.c2
-rw-r--r--test/cache_common.c2
-rw-r--r--test/cache_tagging.c2
-rw-r--r--test/chunk_info.c1
-rw-r--r--test/del_many_dense_attrs.c2
-rw-r--r--test/dsets.c152
-rw-r--r--test/dt_arith.c34
-rw-r--r--test/fillval.c5
-rw-r--r--test/h5test.c3
-rw-r--r--test/null_vol_connector.c6
-rw-r--r--test/swmr_sparse_reader.c4
-rw-r--r--test/tfile.c1
-rw-r--r--test/tid.c25
-rw-r--r--test/trefer.c20
-rw-r--r--test/tvlstr.c4
-rw-r--r--test/vds_swmr.h24
-rw-r--r--test/vds_swmr_common.c36
23 files changed, 133 insertions, 310 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d3f8ed8..c7a945e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -16,11 +16,9 @@ set (TEST_LIB_SOURCES
${HDF5_TEST_SOURCE_DIR}/cache_common.c
${HDF5_TEST_SOURCE_DIR}/external_common.c
${HDF5_TEST_SOURCE_DIR}/swmr_common.c
- ${HDF5_TEST_SOURCE_DIR}/vds_swmr_common.c
)
set (TEST_LIB_HEADERS
- ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h
${HDF5_TEST_SOURCE_DIR}/h5test.h
${HDF5_TEST_SOURCE_DIR}/cache_common.h
${HDF5_TEST_SOURCE_DIR}/external_common.h
diff --git a/test/H5srcdir.c b/test/H5srcdir.c
deleted file mode 100644
index 8268d2c..0000000
--- a/test/H5srcdir.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "H5private.h"
-#include "H5srcdir.h"
-
-/* Buffer to construct path in and return pointer to */
-char srcdir_path[1024] = "";
-
-/* Buffer to construct file in and return pointer to */
-char srcdir_testpath[1024] = "";
-
-/* Just return the srcdir path */
-const char *
-H5_get_srcdir(void)
-{
- const char *srcdir = HDgetenv("srcdir");
-
- /* Check for using the srcdir from configure time */
- if(NULL == srcdir)
- srcdir = config_srcdir;
-
- /* Build path to all test files */
- if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
- HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
- return(srcdir_path);
- } /* end if */
- else
- return(NULL);
-} /* end H5_get_srcdir() */
-
-/* Append the test file name to the srcdir path and return the whole string */
-const char *
-H5_get_srcdir_filename(const char *filename)
-{
- const char *srcdir = H5_get_srcdir();
-
- /* Check for error */
- if(NULL == srcdir)
- return(NULL);
- else {
- /* Build path to test file */
- if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
- HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
- return(srcdir_testpath);
- } /* end if */
- else
- return(NULL);
- } /* end else */
-} /* end H5_get_srcdir_filename() */
-
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
index d0a4bf7..32fe8c9 100644
--- a/test/H5srcdir.h
+++ b/test/H5srcdir.h
@@ -24,16 +24,47 @@
#include "H5srcdir_str.h"
/* Buffer to construct path in and return pointer to */
-extern char srcdir_path[1024];
+static char srcdir_path[1024] = "";
/* Buffer to construct file in and return pointer to */
-extern char srcdir_testpath[1024];
+static char srcdir_testpath[1024] = "";
/* Just return the srcdir path */
-const char *H5_get_srcdir(void);
+static const char *
+H5_get_srcdir(void)
+{
+ const char *srcdir = HDgetenv("srcdir");
+
+ /* Check for using the srcdir from configure time */
+ if(NULL == srcdir)
+ srcdir = config_srcdir;
+
+ /* Build path to all test files */
+ if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
+ HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
+ return(srcdir_path);
+ } /* end if */
+ else
+ return(NULL);
+} /* end H5_get_srcdir() */
/* Append the test file name to the srcdir path and return the whole string */
-const char *H5_get_srcdir_filename(const char *);
+static const char *H5_get_srcdir_filename(const char *filename)
+{
+ const char *srcdir = H5_get_srcdir();
+ /* Check for error */
+ if(NULL == srcdir)
+ return(NULL);
+ else {
+ /* Build path to test file */
+ if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
+ HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
+ return(srcdir_testpath);
+ } /* end if */
+ else
+ return(NULL);
+ } /* end else */
+} /* end H5_get_srcdir_filename() */
#endif /* _H5SRCDIR_H */
diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in
index ba30a88..bab1df3 100644
--- a/test/H5srcdir_str.h.in
+++ b/test/H5srcdir_str.h.in
@@ -16,5 +16,5 @@
*/
/* Set the 'srcdir' path from configure time */
-#define config_srcdir "@srcdir@"
+static const char *config_srcdir = "@srcdir@";
diff --git a/test/Makefile.am b/test/Makefile.am
index d66200d..57080aa 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -135,7 +135,7 @@ else
noinst_LTLIBRARIES=libh5test.la
endif
-libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c H5srcdir.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
@@ -145,12 +145,6 @@ ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \
ttsafe_acreate.c
cache_image_SOURCES=cache_image.c genall5.c
-#filter_plugin_SOURCES=filter_plugin.c H5srcdir.c
-
-vds_swmr_gen_SOURCES=vds_swmr_gen.c vds_swmr_common.c
-vds_swmr_writer_SOURCES=vds_swmr_writer.c vds_swmr_common.c
-vds_swmr_reader_SOURCES=vds_swmr_reader.c vds_swmr_common.c
-
VFD_LIST = sec2 stdio core core_paged split multi family
if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
diff --git a/test/accum.c b/test/accum.c
index f7d02fd..91acf0f 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -1838,6 +1838,7 @@ test_swmr_write_big(hbool_t newest_format)
pid_t pid; /* Process ID */
#endif /* H5_HAVE_UNISTD_H */
int status; /* Status returned from child process */
+ char *new_argv[] = {NULL};
char *driver = NULL; /* VFD string (from env variable) */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@@ -1967,13 +1968,6 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR;
}
else if(0 == pid) { /* Child process */
- /* By convention, argv[0] tells the name of program invoked.
- *
- * execv on NetBSD 8 will actually return EFAULT if there is a
- * NULL at argv[0], so we follow the convention unconditionally.
- */
- char swmr_reader[] = SWMR_READER;
- char * const new_argv[] = {swmr_reader, NULL};
/* Run the reader */
status = HDexecv(SWMR_READER, new_argv);
HDprintf("errno from execv = %s\n", strerror(errno));
diff --git a/test/cache.c b/test/cache.c
index e59dc3e..1a726fa 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -16926,7 +16926,7 @@ check_move_entry_errs(unsigned paged)
{
herr_t result;
H5F_t * file_ptr = NULL;
- H5C_t * cache_ptr;
+ H5C_t * cache_ptr = NULL;
test_entry_t * entry_ptr = NULL;
test_entry_t * entry_0_0_ptr;
test_entry_t * entry_0_1_ptr;
diff --git a/test/cache_common.c b/test/cache_common.c
index 740523e..24962bc 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -5522,7 +5522,7 @@ col_major_scan_backward(H5F_t * file_ptr,
int mile_stone = 1;
int32_t type;
int32_t idx;
- int32_t local_max_index[NUMBER_OF_ENTRY_TYPES] = {0};
+ int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", FUNC);
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index c3921ea..7ce4e88 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -528,7 +528,7 @@ check_file_open_tags(hid_t fcpl, int type)
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose file outout */
hid_t fapl = -1; /* File access prop list */
- haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
+ haddr_t root_tag; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
/* Testing Macro */
diff --git a/test/chunk_info.c b/test/chunk_info.c
index 057991c..dd4dac6 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -53,7 +53,6 @@ const char *FILENAME[] = {
"tchunk_info_v18",
"tchunk_info_v110",
"tchunk_info_v112",
- "tchunk_info_v114",
NULL
};
diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c
index ce85d1b..ada7a6f 100644
--- a/test/del_many_dense_attrs.c
+++ b/test/del_many_dense_attrs.c
@@ -70,7 +70,7 @@ main(void)
hid_t fapl = -1; /* File access property lists */
hid_t gcpl = -1; /* Group creation property list */
char aname[50]; /* Name of attribute */
- const char *basename="attr";/* Name prefix for attribute */
+ char *basename="attr"; /* Name prefix for attribute */
char filename[100]; /* File name */
int i; /* Local index variable */
diff --git a/test/dsets.c b/test/dsets.c
index aa84833..21d5431 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -7022,69 +7022,6 @@ error:
return FAIL;
} /* end test_missing_chunk() */
-/* Using Euclid's algorithm, find the greatest common divisor (GCD) of
- * the two arguments and return it.
- *
- * The GCD is negative if the arguments have opposite sign. Otherwise,
- * it is positive.
- *
- * If either argument is zero, then the result is undefined.
- */
-static long
-gcd(const long l0, const long r0)
-{
- long magnitude, remainder;
- bool negative = ((l0 < 0) != (r0 < 0));
- long l = labs(l0), r = labs(r0);
-
- do {
- if (l < r) {
- r = r % l;
- remainder = r;
- } else /* r <= l */ {
- l = l % r;
- remainder = l;
- }
- } while (remainder != 0);
-
- magnitude = (l == 0) ? r : l;
- return negative ? -magnitude : magnitude;
-}
-
-/* Choose a random offset into an array `nelts` elements long, and store
- * it at `offsetp`. The offset will be in the range [0, nelts - 1].
- * Also choose a random increment, `inc`, that "generates" all
- * indices in [0, nelts - 1] when it is added to itself repeatedly.
- * That is, the range of the discrete function `f(i) = (i * inc)
- * mod nelts` on the domain [0, nelts - 1] is [0, nelts - 1]. Store
- * `inc` at `incp`.
- *
- * If `nelts <= 0`, results are undefined.
- */
-static void
-make_random_offset_and_increment(long nelts, long *offsetp, long *incp)
-{
- long inc;
- /* `maxinc` is chosen so that for any `x` in [0, nelts - 1],
- * `x + maxinc` does not overflow a long.
- */
- const long maxinc = MIN(nelts - 1, LONG_MAX - nelts);
-
- HDassert(0 < nelts);
-
- *offsetp = HDrandom() % nelts;
-
- /* Choose a random number in [1, nelts - 1]. If its greatest divisor
- * in common with `nelts` is 1, then it will "generate" the additive ring
- * [0, nelts - 1], so let it be our increment. Otherwise, choose a new
- * number.
- */
- do {
- inc = 1 + HDrandom() % maxinc;
- } while (gcd(inc, nelts) != 1);
-
- *incp = inc;
-}
/*-------------------------------------------------------------------------
* Function: test_random_chunks_real
@@ -7109,7 +7046,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
rbuf[NPOINTS],
check2[20][20];
hsize_t coord[NPOINTS][2];
- const hsize_t dsize[2]={100,100}, dmax[2]={H5S_UNLIMITED, H5S_UNLIMITED}, csize[2]={10,10}, nsize[2]={200,200};
+ hsize_t dsize[2]={100,100}, dmax[2]={H5S_UNLIMITED, H5S_UNLIMITED}, csize[2]={10,10}, nsize[2]={200,200};
hsize_t fixed_dmax[2] = {1000, 1000};
hsize_t msize[1]={NPOINTS};
const char dname[]="dataset";
@@ -7117,9 +7054,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
size_t i, j;
H5D_chunk_index_t idx_type; /* Dataset chunk index type */
H5F_libver_t low; /* File format low bound */
- long ofs, inc;
- long rows;
- long cols;
+
TESTING(testname);
@@ -7153,16 +7088,12 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j=0; j<dsize[1]/csize[1]; j++)
check2[i][j] = 0;
- rows = (long)(dsize[0]/csize[0]);
- cols = (long)(dsize[1]/csize[1]);
- make_random_offset_and_increment(rows * cols, &ofs, &inc);
-
/* Generate random point coordinates. Only one point is selected per chunk */
for(i=0; i<NPOINTS; i++){
- chunk_row = ofs / cols;
- chunk_col = ofs % cols;
- ofs = (ofs + inc) % (rows * cols);
- HDassert(!check2[chunk_row][chunk_col]);
+ do {
+ chunk_row = (int)HDrandom () % (int)(dsize[0]/csize[0]);
+ chunk_col = (int)HDrandom () % (int)(dsize[1]/csize[1]);
+ } while (check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row+chunk_col+1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -7280,16 +7211,12 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j = 0; j < nsize[1] / csize[1]; j++)
check2[i][j] = 0;
- rows = nsize[0] / csize[0];
- cols = nsize[1] / csize[1];
- make_random_offset_and_increment(rows * cols, &ofs, &inc);
-
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- chunk_row = ofs / cols;
- chunk_col = ofs % cols;
- ofs = (ofs + inc) % (rows * cols);
- HDassert(!check2[chunk_row][chunk_col]);
+ do {
+ chunk_row = (int)HDrandom() % (int)(nsize[0] / csize[0]);
+ chunk_col = (int)HDrandom() % (int)(nsize[1] / csize[1]);
+ } while (check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -7390,16 +7317,12 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j = 0; j < nsize[1] / csize[1]; j++)
check2[i][j] = 0;
- rows = (long)(nsize[0] / csize[0]);
- cols = (long)(nsize[1] / csize[1]);
- make_random_offset_and_increment(rows * cols, &ofs, &inc);
-
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- chunk_row = ofs / cols;
- chunk_col = ofs % cols;
- ofs = (ofs + inc) % (rows * cols);
- HDassert(!check2[chunk_row][chunk_col]);
+ do {
+ chunk_row = (int)HDrandom() % (int)(nsize[0] / csize[0]);
+ chunk_col = (int)HDrandom() % (int)(nsize[1] / csize[1]);
+ } while (check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -9415,7 +9338,7 @@ test_fixed_array(hid_t fapl)
hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */
hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */
- const hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */
+ hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */
hsize_t dim2_max[2] = {120, 50}; /* Maximum dataset dimensions */
hid_t mem_id; /* Memory space ID */
@@ -9429,7 +9352,7 @@ test_fixed_array(hid_t fapl)
int rbuf[POINTS]; /* read buffer */
int *rbuf_big = NULL; /* read buffer for big dataset */
- const hsize_t chunk_dim2[2] = {4, 3}; /* Chunk dimensions */
+ hsize_t chunk_dim2[2] = {4, 3}; /* Chunk dimensions */
int chunks[12][6]; /* # of chunks for dataset dimensions */
int chunks_big[125][20]; /* # of chunks for big dataset dimensions */
int chunk_row; /* chunk row index */
@@ -9451,9 +9374,6 @@ test_fixed_array(hid_t fapl)
size_t i, j; /* local index variables */
herr_t ret; /* Generic return value */
- long ofs, inc;
- long rows;
- long cols;
TESTING("datasets w/fixed array as chunk index");
@@ -9512,20 +9432,16 @@ test_fixed_array(hid_t fapl)
for(j = 0; j < dim2[1]/chunk_dim2[1]; j++)
chunks[i][j] = 0;
- rows = (long)(dim2[0]/chunk_dim2[0]);
- cols = (long)(dim2[1]/chunk_dim2[1]);
- make_random_offset_and_increment(rows * cols, &ofs, &inc);
-
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < POINTS; i++){
- chunk_row = ofs / cols;
- chunk_col = ofs % cols;
- ofs = (ofs + inc) % (rows * cols);
- HDassert(!chunks[chunk_row][chunk_col]);
-
- wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1;
- coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
- coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
+ do {
+ chunk_row = (int)HDrandom () % (int)(dim2[0]/chunk_dim2[0]);
+ chunk_col = (int)HDrandom () % (int)(dim2[1]/chunk_dim2[1]);
+ } while (chunks[chunk_row][chunk_col]);
+
+ wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1;
+ coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
+ coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
} /* end for */
/* Create first dataset with cur and max dimensions */
@@ -9641,20 +9557,16 @@ test_fixed_array(hid_t fapl)
for(j = 0; j < dim2_big[1]/chunk_dim2[1]; j++)
chunks_big[i][j] = 0;
- rows = (long)(dim2_big[0]/chunk_dim2[0]);
- cols = (long)(dim2_big[1]/chunk_dim2[1]);
- make_random_offset_and_increment(rows * cols, &ofs, &inc);
-
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < POINTS_BIG; i++){
- chunk_row = ofs / cols;
- chunk_col = ofs % cols;
- ofs = (ofs + inc) % (rows * cols);
- HDassert(!chunks_big[chunk_row][chunk_col]);
-
- wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1;
- coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
- coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
+ do {
+ chunk_row = (int)HDrandom () % (int)(dim2_big[0]/chunk_dim2[0]);
+ chunk_col = (int)HDrandom () % (int)(dim2_big[1]/chunk_dim2[1]);
+ } while (chunks_big[chunk_row][chunk_col]);
+
+ wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1;
+ coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
+ coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
} /* end for */
/* Create dataspace for write buffer */
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 8d04770..7e1adf5 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -770,7 +770,7 @@ static int test_particular_fp_integer(void)
/* Print errors */
if(dst_c != SCHAR_MAX) {
- double x = 0.;
+ double x;
signed char y;
if(0 == fails_this_test++)
@@ -814,7 +814,7 @@ static int test_particular_fp_integer(void)
/* Print errors */
if(dst_i != fill_value) {
- float x = 0.;
+ float x;
int y;
if(0 == fails_this_test++)
@@ -2723,16 +2723,16 @@ my_isnan(dtype_t type, void *val)
char s[256];
if (FLT_FLOAT==type) {
- float x = 0.;
+ float x;
HDmemcpy(&x, val, sizeof(float));
retval = (x!=x);
} else if (FLT_DOUBLE==type) {
- double x = 0.;
+ double x;
HDmemcpy(&x, val, sizeof(double));
retval = (x!=x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if (FLT_LDOUBLE==type) {
- long double x = 0.;
+ long double x;
HDmemcpy(&x, val, sizeof(long double));
retval = (x!=x);
#endif
@@ -2746,18 +2746,18 @@ my_isnan(dtype_t type, void *val)
*/
if (!retval) {
if (FLT_FLOAT==type) {
- float x = 0.;
+ float x;
HDmemcpy(&x, val, sizeof(float));
HDsnprintf(s, sizeof(s), "%g", (double)x);
} else if (FLT_DOUBLE==type) {
- double x = 0.;
+ double x;
HDmemcpy(&x, val, sizeof(double));
HDsnprintf(s, sizeof(s), "%g", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if (FLT_LDOUBLE==type) {
- long double x = 0.;
+ long double x;
HDmemcpy(&x, val, sizeof(long double));
HDsnprintf(s, sizeof(s), "%Lg", x);
@@ -3197,7 +3197,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
int check_expo[2];
if (FLT_FLOAT==dst_type) {
- float x = 0.;
+ float x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(float));
if (underflow &&
HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN)
@@ -3208,7 +3208,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
check_mant[0] = HDfrexpf(x, check_expo+0);
check_mant[1] = HDfrexpf(hw_f, check_expo+1);
} else if (FLT_DOUBLE==dst_type) {
- double x = 0.;
+ double x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(double));
if (underflow &&
HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN)
@@ -3220,7 +3220,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
check_mant[1] = HDfrexp(hw_d, check_expo+1);
#if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE)
} else {
- long double x = 0.;
+ long double x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
/* dst is largest float, no need to check underflow. */
check_mant[0] = (double)HDfrexpl(x, check_expo+0);
@@ -3265,16 +3265,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]);
HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
if (FLT_FLOAT==src_type) {
- float x = 0.;
+ float x;
HDmemcpy(&x, &saved[j*src_size], sizeof(float));
HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==src_type) {
- double x = 0.;
+ double x;
HDmemcpy(&x, &saved[j*src_size], sizeof(double));
HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
- long double x = 0.;
+ long double x;
HDmemcpy(&x, &saved[j*src_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#endif
@@ -3285,16 +3285,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]);
HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
if (FLT_FLOAT==dst_type) {
- float x = 0.;
+ float x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(float));
HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==dst_type) {
- double x = 0.;
+ double x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(double));
HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
- long double x = 0.;
+ long double x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#endif
diff --git a/test/fillval.c b/test/fillval.c
index dd0ca7f..47cd53a 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -762,11 +762,6 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
- fill_c.a = 0;
- fill_c.x = 0;
- fill_c.y = 0;
- fill_c.z = 0;
-
if(datatype == H5T_INTEGER) {
fillval = *(int*)_fillval;
}
diff --git a/test/h5test.c b/test/h5test.c
index c8f4132..dd8d906 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -106,8 +106,7 @@ const char *LIBVER_NAMES[] = {
"earliest", /* H5F_LIBVER_EARLIEST = 0 */
"v18", /* H5F_LIBVER_V18 = 1 */
"v110", /* H5F_LIBVER_V110 = 2 */
- "v112", /* H5F_LIBVER_V112 = 3 */
- "latest", /* H5F_LIBVER_V114 = 4 */
+ "latest", /* H5F_LIBVER_V112 = 3 */
NULL
};
diff --git a/test/null_vol_connector.c b/test/null_vol_connector.c
index 64f62c4..5ed8545 100644
--- a/test/null_vol_connector.c
+++ b/test/null_vol_connector.c
@@ -116,12 +116,6 @@ static const H5VL_class_t null_vol_g = {
NULL, /* optional */
NULL /* free */
},
- { /* blob_cls */
- NULL, /* put */
- NULL, /* get */
- NULL, /* specific */
- NULL /* optional */
- },
NULL /* optional */
};
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index a969b16..6adc6c5 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
/* Emit informational message */
if(verbose)
- HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]);
+ HDfprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start);
/* Read record from dataset */
record->rec_id = (uint64_t)ULLONG_MAX;
@@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
if(record->rec_id != start[1]) {
HDfprintf(stderr, "*** ERROR ***\n");
HDfprintf(stderr, "Incorrect record value!\n");
- HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju, record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id);
+ HDfprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id);
return -1;
} /* end if */
diff --git a/test/tfile.c b/test/tfile.c
index 4fb2bc9..f6b92eb 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -5769,7 +5769,6 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t n
case H5F_LIBVER_V110:
case H5F_LIBVER_V112:
- case H5F_LIBVER_V114:
ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_3);
VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
break;
diff --git a/test/tid.c b/test/tid.c
index 7a839d2..d0ae3e4 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -19,13 +19,6 @@
#define H5I_FRIEND /*suppress error about including H5Ipkg */
#include "H5Ipkg.h"
-static herr_t
-free_wrapper(void *p)
-{
- HDfree(p);
- return SUCCEED;
-}
-
/* Test basic functionality of registering and deleting types and IDs */
static int basic_id_test(void)
{
@@ -76,7 +69,7 @@ static int basic_id_test(void)
goto out;
/* Register a type */
- myType = H5Iregister_type((size_t)64, 0, free_wrapper);
+ myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -170,7 +163,7 @@ static int basic_id_test(void)
H5E_END_TRY
/* Register another type and another object in that type */
- myType = H5Iregister_type((size_t)64, 0, free_wrapper);
+ myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -245,7 +238,7 @@ out:
/* A dummy search function for the next test */
-static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; }
+static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; }
/* Ensure that public functions cannot access "predefined" ID types */
static int id_predefined_test(void )
@@ -271,7 +264,7 @@ static int id_predefined_test(void )
goto out;
H5E_BEGIN_TRY
- testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj);
+ testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
H5E_END_TRY
CHECK_PTR_NULL(testPtr, "H5Isearch");
@@ -499,7 +492,7 @@ static int test_id_type_list(void)
H5I_type_t testType;
int i; /* Just a counter variable */
- startType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
CHECK(startType, H5I_BADID, "H5Iregister_type");
if(startType == H5I_BADID)
goto out;
@@ -514,7 +507,7 @@ static int test_id_type_list(void)
/* Create types up to H5I_MAX_NUM_TYPES */
for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
{
- currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -523,7 +516,7 @@ static int test_id_type_list(void)
/* Wrap around to low type ID numbers */
for(i = H5I_NTYPES; i < startType; i++)
{
- currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -531,7 +524,7 @@ static int test_id_type_list(void)
/* There should be no room at the inn for a new ID type*/
H5E_BEGIN_TRY
- testType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
H5E_END_TRY
VERIFY(testType, H5I_BADID, "H5Iregister_type");
@@ -540,7 +533,7 @@ static int test_id_type_list(void)
/* Now delete a type and try to insert again */
H5Idestroy_type(H5I_NTYPES);
- testType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
if(testType != H5I_NTYPES)
diff --git a/test/trefer.c b/test/trefer.c
index b722b2b..0fce2a3 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -137,7 +137,7 @@ test_reference_params(void)
CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -357,7 +357,7 @@ test_reference_obj(void)
CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -470,11 +470,11 @@ test_reference_obj(void)
VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints");
/* Read from disk */
- ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf);
CHECK(ret, FAIL, "H5Dread");
- for(i = 0; i < SPACE1_DIM1; i++)
- VERIFY(ibuf[i], i * 3, "Data");
+ for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
+ VERIFY(*tu32, (uint32_t)(i*3), "Data");
/* Close dereferenced Dataset */
ret = H5Dclose(dset2);
@@ -530,8 +530,7 @@ test_reference_obj(void)
/* Free memory buffers */
HDfree(wbuf);
HDfree(rbuf);
- HDfree(ibuf);
- HDfree(obuf);
+ HDfree(tbuf);
} /* test_reference_obj() */
/****************************************************************
@@ -1735,7 +1734,6 @@ test_reference_attr(void)
CHECK(ret, FAIL, "H5Dread");
/* Open attribute on dataset object */
-
attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
@@ -2271,9 +2269,9 @@ test_reference_compat_conv(void)
ret = H5Sclose(sid3);
CHECK(ret, FAIL, "H5Sclose");
- /* Open attribute on group object */
- attr = H5Ropen_attr(&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file */
fid1 = H5Fopen(FILE_REF_COMPAT, H5F_ACC_RDWR, H5P_DEFAULT);
diff --git a/test/tvlstr.c b/test/tvlstr.c
index cc01084..731270c 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -861,12 +861,12 @@ static void test_write_same_element(void)
hid_t file1, dataset1;
hid_t mspace, fspace, dtype;
hsize_t fdim[] = {SPACE1_DIM1};
- const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
+ char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
hsize_t marray[] = {NUMP};
hsize_t coord[SPACE1_RANK][NUMP];
herr_t ret;
- const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
+ char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1, FAIL, "H5Fcreate");
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index 18d6b35..eb2dcf4 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -84,17 +84,31 @@
#define N_PLANES_TO_WRITE 25
/* Planes */
-extern hsize_t PLANES[N_SOURCES][RANK];
+static hsize_t PLANES[N_SOURCES][RANK] = {
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH}
+};
/* File names for source datasets */
-extern char FILE_NAMES[N_SOURCES][NAME_LEN];
+static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
+ {"vds_swmr_src_a.h5"},
+ {"vds_swmr_src_b.h5"},
+ {"vds_swmr_src_c.h5"},
+ {"vds_swmr_src_d.h5"},
+ {"vds_swmr_src_e.h5"},
+ {"vds_swmr_src_f.h5"}
+};
/* VDS file name */
-extern char VDS_FILE_NAME[NAME_LEN];
+static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
/* Dataset names */
-extern char SOURCE_DSET_PATH[NAME_LEN];
-extern char VDS_DSET_NAME[NAME_LEN];
+static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
+static char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
/* Fill values */
#endif /* VDS_SWMR_H */
diff --git a/test/vds_swmr_common.c b/test/vds_swmr_common.c
deleted file mode 100644
index d2b4bd6..0000000
--- a/test/vds_swmr_common.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "vds_swmr.h"
-
-hsize_t PLANES[N_SOURCES][RANK] = {
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH}
-};
-
-char FILE_NAMES[N_SOURCES][NAME_LEN] = {
- {"vds_swmr_src_a.h5"},
- {"vds_swmr_src_b.h5"},
- {"vds_swmr_src_c.h5"},
- {"vds_swmr_src_d.h5"},
- {"vds_swmr_src_e.h5"},
- {"vds_swmr_src_f.h5"}
-};
-
-char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
-char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
-char VDS_DSET_NAME[NAME_LEN] = "vds_dset";