summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2019-07-10 03:21:33 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2019-07-10 03:21:33 (GMT)
commit22d78bdfa4d560a0b8a2dbb547574bfe61bf64f0 (patch)
tree43f503fea615b405e03863e1befc1c91bd9f65ef /test
parentc33f2cbf18b4cc0aafedfe2d1cc29ed7730c91f6 (diff)
parent73df02f13c2b1e0b256cdbff1c7c584e84548df4 (diff)
downloadhdf5-22d78bdfa4d560a0b8a2dbb547574bfe61bf64f0.zip
hdf5-22d78bdfa4d560a0b8a2dbb547574bfe61bf64f0.tar.gz
hdf5-22d78bdfa4d560a0b8a2dbb547574bfe61bf64f0.tar.bz2
Merge pull request #1788 in HDFFV/hdf5 from ~KOZIOL/hdf5:feature/update_gcc_flags to develop
* commit '73df02f13c2b1e0b256cdbff1c7c584e84548df4': Updates to warnhist script, along with a few cleanups, and add some comments to warning cleanups that are a bit obscure. Cleaned up code that genericizes warning output, and add "-u" option to leave unique types in warnings (i.e. don't genericize output). Also fixed the '-S' option to work correctly. Added GCC9 flags to CMake build Add support for GCC9, update warnhist script, and clean up warnings.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/big.c9
-rw-r--r--test/enc_dec_plist.c4
-rw-r--r--test/error_test.c9
-rw-r--r--test/external.c3
-rw-r--r--test/external_common.h12
-rw-r--r--test/external_env.c1
-rw-r--r--test/external_fname.h37
-rw-r--r--test/fheap.c50
-rw-r--r--test/file_image.c9
-rw-r--r--test/h5test.c21
-rw-r--r--test/h5test.h2
-rw-r--r--test/ohdr.c4
-rw-r--r--test/tid.c2
-rw-r--r--test/ttsafe_error.c2
-rw-r--r--test/use_disable_mdc_flushes.c8
-rw-r--r--test/vds.c4
-rw-r--r--test/vds_env.c4
-rw-r--r--test/vds_swmr.h48
-rw-r--r--test/vds_swmr_gen.c46
-rw-r--r--test/vds_swmr_reader.c2
-rw-r--r--test/vfd.c27
22 files changed, 211 insertions, 94 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 15d10a7..9173531 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -22,6 +22,7 @@ set (TEST_LIB_HEADERS
${HDF5_TEST_SOURCE_DIR}/h5test.h
${HDF5_TEST_SOURCE_DIR}/cache_common.h
${HDF5_TEST_SOURCE_DIR}/external_common.h
+ ${HDF5_TEST_SOURCE_DIR}/external_fname.h
${HDF5_TEST_SOURCE_DIR}/swmr_common.h
)
diff --git a/test/big.c b/test/big.c
index b3105eb..46acc5e 100644
--- a/test/big.c
+++ b/test/big.c
@@ -275,6 +275,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
enough_room(hid_t fapl)
{
@@ -315,6 +323,7 @@ done:
return ret_value;
}
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index 23bec6e..826957f 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -190,8 +190,8 @@ main(void)
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
char msg[80]; /* Message for file version bounds */
- char* low_string; /* The low bound string */
- char* high_string; /* The high bound string */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
/* Invalid combinations, just continue */
if(high == H5F_LIBVER_EARLIEST || high < low)
diff --git a/test/error_test.c b/test/error_test.c
index 5356fa7..44f6210 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -320,6 +320,14 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'full_desc' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_long_desc(void)
{
@@ -374,6 +382,7 @@ error:
return -1;
} /* end test_long_desc() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
diff --git a/test/external.c b/test/external.c
index 6aa9d1b..597878f 100644
--- a/test/external.c
+++ b/test/external.c
@@ -18,6 +18,7 @@
* Purpose: Tests datasets stored in external raw files.
*/
#include "external_common.h"
+#include "external_fname.h"
/*-------------------------------------------------------------------------
@@ -864,7 +865,7 @@ test_path_absolute(hid_t fapl)
hid_t dset = -1; /* dataset */
size_t i; /* miscellaneous counter */
char cwdpath[1024]; /* working directory */
- char filename[1024]; /* file name */
+ char filename[1536]; /* file name */
int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
hsize_t cur_size; /* current data space size */
diff --git a/test/external_common.h b/test/external_common.h
index 1e4fe7a..a2cb03e 100644
--- a/test/external_common.h
+++ b/test/external_common.h
@@ -23,16 +23,6 @@
/* Include test header files */
#include "h5test.h"
-static const char *EXT_FNAME[] = {
- "extern_1",
- "extern_2",
- "extern_3",
- "extern_4",
- "extern_dir/file_1",
- "extern_5",
- NULL
-};
-
/* A similar collection of files is used for the tests that
* perform file I/O.
*/
@@ -42,4 +32,6 @@ static const char *EXT_FNAME[] = {
#define GARBAGE_PER_FILE 10
H5TEST_DLL herr_t reset_raw_data_files(int);
+
#endif /* _EXTERNAL_COMMON_H */
+
diff --git a/test/external_env.c b/test/external_env.c
index 1bf0cf0..8ecebf6 100644
--- a/test/external_env.c
+++ b/test/external_env.c
@@ -15,6 +15,7 @@
* Purpose: Tests datasets stored in external raw files.
*/
#include "external_common.h"
+#include "external_fname.h"
static const char *EXT_ENV_FNAME[] = {
"extern_env_dir/env_file_1",
diff --git a/test/external_fname.h b/test/external_fname.h
new file mode 100644
index 0000000..c5111b6
--- /dev/null
+++ b/test/external_fname.h
@@ -0,0 +1,37 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@lbl.gov>
+ * July, 2019
+ *
+ * Purpose: Private declaration for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_FNAME_H
+#define _EXTERNAL_FNAME_H
+
+/* Include test header files */
+#include "h5test.h"
+
+static const char *EXT_FNAME[] = {
+ "extern_1",
+ "extern_2",
+ "extern_3",
+ "extern_4",
+ "extern_dir/file_1",
+ "extern_5",
+ NULL
+};
+
+#endif /* _EXTERNAL_FNAME_H */
+
diff --git a/test/fheap.c b/test/fheap.c
index 91a1df5..ef47d94 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -539,6 +539,14 @@ get_fill_size(const fheap_test_param_t *tparam)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * test_desc in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
begin_test(fheap_test_param_t *tparam, const char *base_desc,
fheap_heap_ids_t *keep_ids, size_t *fill_size)
@@ -567,6 +575,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
/* Success */
return(0);
} /* end begin_test() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -6650,7 +6659,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if((H5HF_close(fh)) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
fh = NULL;
@@ -6842,7 +6851,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if((H5HF_close(fh)) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
fh = NULL;
@@ -7012,6 +7021,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -13694,28 +13704,30 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
haddr_t fh_addr; /* Address of fractal heap */
- H5HF_create_t tmp_cparam; /* Local heap creation parameters */
- fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
- size_t id_len; /* Size of fractal heap IDs */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- h5_stat_size_t file_size; /* Size of file currently */
- unsigned char *heap_id = NULL; /* Heap ID for object */
- size_t obj_size; /* Size of object */
- size_t robj_size; /* Size of object read */
- unsigned char obj_type; /* Type of storage for object */
- fheap_heap_state_t state; /* State of fractal heap */
- unsigned deflate_level; /* Deflation level */
- size_t old_actual_id_len =0 ; /* Old actual ID length */
- hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
- const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
+ H5HF_create_t tmp_cparam; /* Local heap creation parameters */
+ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
+ size_t id_len; /* Size of fractal heap IDs */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ h5_stat_size_t file_size; /* Size of file currently */
+ unsigned char *heap_id = NULL; /* Heap ID for object */
+ size_t obj_size; /* Size of object */
+ size_t robj_size; /* Size of object read */
+ unsigned char obj_type; /* Type of storage for object */
+ fheap_heap_state_t state; /* State of fractal heap */
+ unsigned deflate_level; /* Deflation level */
+ size_t old_actual_id_len = 0; /* Old actual ID length */
+ hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
+ hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */
+ const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
- /* Copy heap creation properties */
- HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
+ /* Copy heap creation properties */
+ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
/* Set an I/O filter for heap data */
deflate_level = 6;
if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, (size_t)1, &deflate_level) < 0)
FAIL_STACK_ERROR
+ pline_init = TRUE;
/* Adjust actual ID length, if asking for IDs that can directly access 'huge' objects */
if(cparam->id_len == 1) {
@@ -13878,7 +13890,7 @@ error:
H5MM_xfree(heap_id);
if(fh)
H5HF_close(fh);
- if(&tmp_cparam.pline)
+ if(pline_init)
H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
H5Fclose(file);
} H5E_END_TRY;
diff --git a/test/file_image.c b/test/file_image.c
index 86dd13e..ddbec80 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -672,6 +672,14 @@ error:
*
******************************************************************************
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
test_get_file_image(const char * test_banner,
const int file_name_num,
@@ -938,6 +946,7 @@ test_get_file_image(const char * test_banner,
error:
return 1;
} /* end test_get_file_image() */
+#pragma GCC diagnostic pop
/******************************************************************************
diff --git a/test/h5test.c b/test/h5test.c
index 59ccfe4..d83c6e7 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -190,6 +190,14 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * sub_filename in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
@@ -239,6 +247,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
return;
} /* end h5_delete_test_file() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -1344,6 +1353,14 @@ h5_dump_info_object(MPI_Info info)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1445,12 +1462,14 @@ h5_get_file_size(const char *filename, hid_t fapl)
return(-1);
} /* end get_file_size() */
+#pragma GCC diagnostic pop
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and allow easy replacement for environments which don't have stdin/stdout
* available. (i.e. Windows & the Mac)
*/
+H5_ATTR_FORMAT(printf, 1, 2)
int
print_func(const char *format, ...)
{
@@ -2016,7 +2035,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-char *
+H5_ATTR_PURE const char *
h5_get_version_string(H5F_libver_t libver)
{
return(LIBVER_NAMES[libver]);
diff --git a/test/h5test.h b/test/h5test.h
index 448813e..a0c8974 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -149,7 +149,7 @@ H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_co
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void);
-H5TEST_DLL char *h5_get_version_string(H5F_libver_t libver);
+H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver);
/* Functions that will replace components of a FAPL */
H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id);
diff --git a/test/ohdr.c b/test/ohdr.c
index facedd5..c5d5ac4 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -1626,8 +1626,8 @@ main(void)
/* Loop through all the combinations of low/high library format bounds */
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
- char *low_string = NULL; /* Message for library version low bound */
- char *high_string = NULL; /* Message for library version high bound */
+ const char *low_string; /* Message for library version low bound */
+ const char *high_string; /* Message for library version high bound */
char msg[80]; /* Message for file format version */
/* Set version bounds before opening the file */
diff --git a/test/tid.c b/test/tid.c
index 7f61c6a..d0ae3e4 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -498,7 +498,7 @@ static int test_id_type_list(void)
goto out;
/* Sanity check */
- if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
+ if((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
{
/* Error condition, throw an error */
CHECK(1, 1, "H5Iregister_type");
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 5e26888..9eeaa24 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -38,7 +38,7 @@
/* Having a common dataset name is an error */
#define DATASETNAME "commonname"
-#define EXPECTED_ERROR_DEPTH 9
+#define EXPECTED_ERROR_DEPTH 10
#define WRITE_NUMBER 37
/* Typedefs */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 340f578..67e2226 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -108,28 +108,28 @@ parse_option(int argc, char * const argv[])
filename_g = optarg;
break;
case 'n': /* number of planes to write/read */
- if ((nplanes_g = atoi(optarg)) <= 0){
+ if ((nplanes_g = HDatoi(optarg)) <= 0){
fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 's': /* use swmr file open mode */
- if ((use_swmr_g = atoi(optarg)) < 0){
+ if ((use_swmr_g = HDatoi(optarg)) < 0){
fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'y': /* Number of planes per chunk */
- if ((chunkplanes_g = atoi(optarg)) <= 0){
+ if ((chunkplanes_g = HDatoi(optarg)) <= 0){
fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'z': /* size of chunk=(z,z) */
- if ((chunksize_g = atoi(optarg)) <= 0){
+ if ((chunksize_g = HDatoi(optarg)) <= 0){
fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
diff --git a/test/vds.c b/test/vds.c
index a042a75..25d7a0e 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -12168,8 +12168,8 @@ main(void)
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
char msg[80]; /* Message for file version bounds */
- char *low_string; /* The low bound string */
- char *high_string; /* The high bound string */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
/* Invalid combinations, just continue */
if(high == H5F_LIBVER_EARLIEST || high < low)
diff --git a/test/vds_env.c b/test/vds_env.c
index 9c7b698..b2ca9d0 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -315,8 +315,8 @@ main(void)
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
char msg[80]; /* Message for file version bounds */
- char *low_string; /* The low bound string */
- char *high_string; /* The high bound string */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
/* Invalid combinations, just continue */
if(high == H5F_LIBVER_EARLIEST || high < low)
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index a8e4d50..eb2dcf4 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -77,48 +77,12 @@
/* Dataset dimensions */
#define SM_HEIGHT 2 /* K */
#define LG_HEIGHT 4 /* N */
-#define SM_LG_HEIGHT 6 /* SM_HEIGHT + LG_HEIGHT */
#define FULL_HEIGHT 18 /* (3 * K) + (3 * N) */
-#define HALF_HEIGHT 9
#define WIDTH 8 /* M */
-#define HALF_WIDTH 4
-
-/* Max number of planes in the dataset */
-#define N_MAX_PLANES H5S_UNLIMITED
/* Number of planes each writer will write */
#define N_PLANES_TO_WRITE 25
-/* Dataset datatypes */
-#define SOURCE_DATATYPE H5T_STD_I32LE
-#define VDS_DATATYPE H5T_STD_I32LE
-
-/* Starting size of datasets, both source and VDS */
-static hsize_t DIMS[N_SOURCES][RANK] = {
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH},
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH},
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH}
-};
-static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH};
-
-/* Maximum size of datasets, both source and VDS.
- * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max
- * number of planes written out by the writers before they stop.
- * That number is specified separately.
- */
-static hsize_t MAX_DIMS[N_SOURCES][RANK] = {
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH},
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH},
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH}
-};
-static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH};
-
/* Planes */
static hsize_t PLANES[N_SOURCES][RANK] = {
{1, SM_HEIGHT, WIDTH},
@@ -128,7 +92,6 @@ static hsize_t PLANES[N_SOURCES][RANK] = {
{1, SM_HEIGHT, WIDTH},
{1, LG_HEIGHT, WIDTH}
};
-static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
/* File names for source datasets */
static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
@@ -144,20 +107,9 @@ static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
/* Dataset names */
-static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset";
static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
static char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
/* Fill values */
-static int32_t FILL_VALUES[N_SOURCES] = {
- -1,
- -2,
- -3,
- -4,
- -5,
- -6
-};
-static int32_t VDS_FILL_VALUE = -9;
-
#endif /* VDS_SWMR_H */
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 1cb9744..2589653 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -14,6 +14,52 @@
#include "h5test.h"
#include "vds_swmr.h"
+/* Max number of planes in the dataset */
+#define N_MAX_PLANES H5S_UNLIMITED
+
+/* Dataset datatypes */
+#define SOURCE_DATATYPE H5T_STD_I32LE
+#define VDS_DATATYPE H5T_STD_I32LE
+
+/* Starting size of datasets, both source and VDS */
+static hsize_t DIMS[N_SOURCES][RANK] = {
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH},
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH},
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH}
+};
+static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH};
+
+/* Maximum size of datasets, both source and VDS.
+ * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max
+ * number of planes written out by the writers before they stop.
+ * That number is specified separately.
+ */
+static hsize_t MAX_DIMS[N_SOURCES][RANK] = {
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH},
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH},
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH}
+};
+static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH};
+
+static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset";
+
+static int32_t FILL_VALUES[N_SOURCES] = {
+ -1,
+ -2,
+ -3,
+ -4,
+ -5,
+ -6
+};
+
+static int32_t VDS_FILL_VALUE = -9;
+
int
main(void)
{
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index d0ec77b..eb9a82b 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -14,6 +14,8 @@
#include "h5test.h"
#include "vds_swmr.h"
+static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
+
int
main(void)
{
diff --git a/test/vfd.c b/test/vfd.c
index 2305593..b196406 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -769,6 +769,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'first_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_family_opens(char *fname, hid_t fa_pl)
{
@@ -825,6 +833,7 @@ test_family_opens(char *fname, hid_t fa_pl)
error:
return -1;
} /* end test_family_opens() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -1027,6 +1036,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_family_compat(void)
{
@@ -1110,6 +1127,7 @@ error:
return -1;
} /* end test_family_compat() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -1125,6 +1143,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'sf_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_multi_opens(char *fname)
{
@@ -1142,6 +1168,7 @@ test_multi_opens(char *fname)
return(fid >= 0 ? FAIL : SUCCEED);
} /* end test_multi_opens() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------