summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-23 01:46:53 (GMT)
committerKimmy Mu <kmu@hdfgroup.org>2020-01-23 01:46:53 (GMT)
commit8ce59829e4064debc973ec750cd700eec288a19f (patch)
tree4c66f1e6e9fff1e9794e96dcac2bf9624f360c6b /test
parentad8e79beece8ddea71715d3fd2634af12d78ca29 (diff)
parent145ef3ceee20c28a443bd11507c58858bea3f889 (diff)
downloadhdf5-8ce59829e4064debc973ec750cd700eec288a19f.zip
hdf5-8ce59829e4064debc973ec750cd700eec288a19f.tar.gz
hdf5-8ce59829e4064debc973ec750cd700eec288a19f.tar.bz2
Merge pull request #2094 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/unused to develop
* commit '145ef3ceee20c28a443bd11507c58858bea3f889': more cleanup change it back pick up missing piece fix unused related warnings removed unused parameter more fix and address comments remove unsed var,function,macro, etc
Diffstat (limited to 'test')
-rw-r--r--test/cache_common.c67
-rw-r--r--test/cache_tagging.c3
-rw-r--r--test/dsets.c8
-rw-r--r--test/dtypes.c2
-rw-r--r--test/mf.c8
-rw-r--r--test/page_buffer.c23
-rw-r--r--test/tfile.c9
-rw-r--r--test/tmisc.c10
-rw-r--r--test/tselect.c3
-rw-r--r--test/vds_swmr.h10
10 files changed, 66 insertions, 77 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index f977c3c..038a0ed 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -17,6 +17,7 @@
* This file contains common code for tests of the cache
* implemented in H5C.c
*/
+#include "H5private.h"
#include "H5CXprivate.h" /* API Contexts */
#include "H5MMprivate.h"
@@ -553,7 +554,7 @@ addr_to_type_and_index(haddr_t addr,
*-------------------------------------------------------------------------
*/
static herr_t
-get_initial_load_size(void *udata, size_t *image_length, int32_t entry_type)
+get_initial_load_size(void *udata, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -663,7 +664,7 @@ notify_get_initial_load_size(void *udata, size_t *image_length)
*/
static herr_t
get_final_load_size(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED image_len,
- void *udata, size_t *actual_len, int32_t entry_type)
+ void *udata, size_t *actual_len, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -723,7 +724,8 @@ variable_get_final_load_size(const void *image, size_t image_len,
*/
static htri_t
-verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t entry_type)
+verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata,
+ int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -776,8 +778,8 @@ variable_verify_chksum(const void *image, size_t len, void *udata)
*-------------------------------------------------------------------------
*/
static void *
-deserialize(const void *image, size_t len, void *udata, hbool_t *dirty,
- int32_t entry_type)
+deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hbool_t *dirty,
+ int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -933,12 +935,10 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty)
*-------------------------------------------------------------------------
*/
herr_t
-image_len(const void *thing, size_t *image_length, int32_t entry_type)
+image_len(const void *thing, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
const test_entry_t *entry;
- test_entry_t *base_addr;
int32_t type;
- int32_t idx;
HDassert(thing);
HDassert(image_length);
@@ -948,14 +948,12 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type)
HDassert(entry->self == entry);
type = entry->type;
- idx = entry->index;
HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
HDassert(type == entry_type);
- HDassert((idx >= 0) && (idx <= max_indices[type]));
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[type]));
- base_addr = entries[type];
- HDassert(entry == &(base_addr[idx]));
+ HDassert(entry == &(entries[type][entry->index]));
if(type != VARIABLE_ENTRY_TYPE)
HDassert(entry->size == entry_sizes[type]);
@@ -1055,18 +1053,15 @@ notify_image_len(const void *thing, size_t *image_length)
*-------------------------------------------------------------------------
*/
herr_t
-pre_serialize(H5F_t *f,
+pre_serialize(H5F_t H5_ATTR_NDEBUG_UNUSED *f,
void *thing,
- haddr_t addr,
- size_t len,
+ haddr_t H5_ATTR_NDEBUG_UNUSED addr,
+ size_t H5_ATTR_NDEBUG_UNUSED len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
test_entry_t *entry;
- test_entry_t *base_addr;
- int32_t type;
- int32_t idx;
int32_t i;
HDassert(f);
@@ -1086,16 +1081,9 @@ pre_serialize(H5F_t *f,
/* shouldn't serialize the entry unless it is dirty */
HDassert(entry->is_dirty);
-
- type = entry->type;
- idx = entry->index;
-
- HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
- HDassert((idx >= 0) && (idx <= max_indices[type]));
-
- base_addr = entries[type];
-
- HDassert(entry == &(base_addr[idx]));
+ HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES));
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[entry->type]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry->num_flush_ops >= 0);
HDassert(entry->num_flush_ops < MAX_FLUSH_OPS);
@@ -1307,9 +1295,7 @@ herr_t
serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing)
{
test_entry_t *entry;
- test_entry_t *base_addr;
int32_t type;
- int32_t idx;
HDassert(image_ptr);
HDassert(thing);
@@ -1323,14 +1309,11 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin
HDassert(entry->is_dirty);
type = entry->type;
- idx = entry->index;
HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
- HDassert((idx >= 0) && (idx <= max_indices[type]));
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[type]));
- base_addr = entries[type];
-
- HDassert(entry == &(base_addr[idx]));
+ HDassert(entry == &(entries[type][entry->index]));
HDassert(entry->num_flush_ops >= 0);
HDassert(entry->num_flush_ops < MAX_FLUSH_OPS);
@@ -1461,21 +1444,19 @@ notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
*-------------------------------------------------------------------------
*/
static herr_t
-notify(H5C_notify_action_t action, void *thing, int32_t entry_type)
+notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
- test_entry_t *base_addr;
HDassert(thing);
entry = (test_entry_t *)thing;
- base_addr = entries[entry->type];
HDassert(entry->index >= 0);
HDassert(entry->index <= max_indices[entry->type]);
HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES));
HDassert(entry->type == entry_type);
- HDassert(entry == &(base_addr[entry->index]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry == entry->self);
if(!(action == H5C_NOTIFY_ACTION_ENTRY_DIRTIED && entry->action == TEST_ENTRY_ACTION_MOVE))
HDassert(entry->header.addr == entry->addr);
@@ -1540,18 +1521,14 @@ notify_notify(H5C_notify_action_t action, void *thing)
*-------------------------------------------------------------------------
*/
herr_t
-free_icr(test_entry_t *entry, int32_t entry_type)
+free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
- test_entry_t *base_addr;
-
HDassert(entry);
- base_addr = entries[entry->type];
-
HDassert(entry->type == entry_type);
HDassert(entry->index >= 0);
HDassert(entry->index <= max_indices[entry->type]);
- HDassert(entry == &(base_addr[entry->index]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry == entry->self);
HDassert(entry->cache_ptr != NULL);
HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC);
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 564e5bc..cf0cd8d 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -3900,9 +3900,10 @@ check_invalid_tag_application(void)
#if H5C_DO_TAGGING_SANITY_CHECKS
error:
if(api_ctx_pushed) H5CX_pop();
-#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
return 1;
+#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
+
} /* check_invalid_tag_application */
diff --git a/test/dsets.c b/test/dsets.c
index 7684de4..061642a 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -7655,10 +7655,10 @@ static herr_t
test_deprec(hid_t file)
{
hid_t dataset, space, small_space, create_parms, dcpl;
- hsize_t dims[2], small_dims[2];
- hsize_t deprec_size;
- herr_t status;
- hsize_t csize[2];
+ hsize_t dims[2], small_dims[2];
+ hsize_t deprec_size;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
+ hsize_t csize[2];
TESTING("deprecated API routines");
diff --git a/test/dtypes.c b/test/dtypes.c
index ec82ffd..0f95830 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -6732,7 +6732,7 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl,
hid_t my_fapl; /* Copy of file access property list ID */
hid_t dcpl; /* Dataset creation property list ID */
unsigned use_at_least_v18;/* Whether to use old or new format */
- herr_t status; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Generic return value */
/* Make copy of FAPL */
my_fapl = H5Pcopy(fapl);
diff --git a/test/mf.c b/test/mf.c
index 3c33163..141f5ec 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -7528,7 +7528,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
+set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split)
{
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl_arr[H5FD_MEM_NTYPES];
@@ -7537,7 +7537,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
hbool_t relax;
H5FD_mem_t mt;
- HDassert(multi || split);
+ HDassert(is_multi_or_split);
HDmemset(memb_name, 0, sizeof memb_name);
@@ -7545,7 +7545,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
if(H5Pget_fapl_multi(fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0)
TEST_ERROR
- if(split) {
+ if(is_multi_or_split) {
/* Set memb_addr aligned */
memb_addr[H5FD_MEM_SUPER] = ((memb_addr[H5FD_MEM_SUPER] + pagesize - 1) / pagesize) * pagesize;
memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize;
@@ -7614,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if((fapl_new = H5Pcopy(fapl)) < 0) TEST_ERROR
if(multi || split)
- if(set_multi_split(fapl_new, 4096, multi, split) < 0)
+ if(set_multi_split(fapl_new, 4096, split) < 0)
TEST_ERROR;
/* Test with TRUE or FALSE for persisting free-space */
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 5313c9b..21ffbf5 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -38,23 +38,25 @@
#define FILENAME_LEN 1024
+
+/* test routines */
+#ifdef H5_HAVE_PARALLEL
+static unsigned verify_page_buffering_disabled(hid_t orig_fapl,
+ const char *env_h5_drvr);
+#else
#define NUM_DSETS 5
#define NX 100
#define NY 50
-/* helper routines */
-static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl);
-static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size);
-
-/* test routines */
static unsigned test_args(hid_t fapl, const char *env_h5_drvr);
static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr);
-#ifdef H5_HAVE_PARALLEL
-static unsigned verify_page_buffering_disabled(hid_t orig_fapl,
- const char *env_h5_drvr);
+
+/* helper routines */
+static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl);
+static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size);
#endif /* H5_HAVE_PARALLEL */
const char *FILENAME[] = {
@@ -62,6 +64,7 @@ const char *FILENAME[] = {
NULL
};
+#ifndef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: create_file()
@@ -296,6 +299,7 @@ error:
} H5E_END_TRY;
return 1;
}
+#endif /* H5_HAVE_PARALLEL */
/*
*
@@ -357,6 +361,7 @@ error:
} /* set_multi_split() */
+#ifndef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: test_args()
@@ -379,6 +384,7 @@ error:
*
*-------------------------------------------------------------------------
*/
+
static unsigned
test_args(hid_t orig_fapl, const char *env_h5_drvr)
{
@@ -2002,6 +2008,7 @@ error:
return 1;
} /* test_stats_collection */
+#endif /* #ifndef H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
diff --git a/test/tfile.c b/test/tfile.c
index 4c23488..d6047dc 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -25,6 +25,7 @@
#include "H5Iprivate.h"
#include "H5Pprivate.h"
#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5private.h"
/*
* This file needs to access private information from the H5F package.
@@ -4208,7 +4209,7 @@ test_filespace_info(const char *env_h5_drvr)
**
*****************************************************************/
static int
-set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
+set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split)
{
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl_arr[H5FD_MEM_NTYPES];
@@ -4217,7 +4218,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
hbool_t relax;
H5FD_mem_t mt;
- HDassert(split || multi);
+ HDassert(split);
HDmemset(memb_name, 0, sizeof memb_name);
@@ -4308,7 +4309,7 @@ test_file_freespace(const char *env_h5_drvr)
my_fapl = new_fapl;
if(multi_vfd || split_vfd) {
- ret = set_multi_split(new_fapl, FSP_SIZE_DEF, multi_vfd, split_vfd);
+ ret = set_multi_split(new_fapl, FSP_SIZE_DEF, split_vfd);
CHECK(ret, FAIL, "set_multi_split");
}
@@ -4474,7 +4475,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/* Set up paged aligned address space for multi/split driver */
if(multi_vfd || split_vfd) {
- ret = set_multi_split(fapl, FSP_SIZE_DEF, multi_vfd, split_vfd);
+ ret = set_multi_split(fapl, FSP_SIZE_DEF, split_vfd);
CHECK(ret, FAIL, "set_multi_split");
}
diff --git a/test/tmisc.c b/test/tmisc.c
index 7b7f5ba..0ea9c4c 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -128,15 +128,19 @@ typedef struct
/* Definitions for misc. test #8 */
#define MISC8_FILE "tmisc8.h5"
#define MISC8_DSETNAME1 "Dataset1"
-#define MISC8_DSETNAME2 "Dataset2"
-#define MISC8_DSETNAME3 "Dataset3"
#define MISC8_DSETNAME4 "Dataset4"
#define MISC8_DSETNAME5 "Dataset5"
+#define MISC8_DSETNAME8 "Dataset8"
+
+#ifndef H5_HAVE_PARALLEL
+#define MISC8_DSETNAME2 "Dataset2"
+#define MISC8_DSETNAME3 "Dataset3"
#define MISC8_DSETNAME6 "Dataset6"
#define MISC8_DSETNAME7 "Dataset7"
-#define MISC8_DSETNAME8 "Dataset8"
#define MISC8_DSETNAME9 "Dataset9"
#define MISC8_DSETNAME10 "Dataset10"
+#endif
+
#define MISC8_RANK 2
#define MISC8_DIM0 50
#define MISC8_DIM1 50
diff --git a/test/tselect.c b/test/tselect.c
index 27bc36b..390f61f 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -25,7 +25,6 @@
#define H5S_TESTING
#include "testhdf5.h"
-#include "hdf5.h"
#include "H5Spkg.h" /* Dataspaces */
#define FILENAME "tselect.h5"
@@ -1613,7 +1612,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
****************************************************************/
static void
verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf,
- size_t cube_size, unsigned edge_size, unsigned cube_rank)
+ size_t H5_ATTR_NDEBUG_UNUSED cube_size, unsigned edge_size, unsigned cube_rank)
{
const uint16_t *cube_ptr; /* Pointer into the cube buffer */
uint16_t expected_value; /* Expected value in dataset */
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index eb2dcf4..43c78a4 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -84,7 +84,7 @@
#define N_PLANES_TO_WRITE 25
/* Planes */
-static hsize_t PLANES[N_SOURCES][RANK] = {
+H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK] = {
{1, SM_HEIGHT, WIDTH},
{1, LG_HEIGHT, WIDTH},
{1, SM_HEIGHT, WIDTH},
@@ -94,7 +94,7 @@ static hsize_t PLANES[N_SOURCES][RANK] = {
};
/* File names for source datasets */
-static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
+H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN] = {
{"vds_swmr_src_a.h5"},
{"vds_swmr_src_b.h5"},
{"vds_swmr_src_c.h5"},
@@ -104,11 +104,11 @@ static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
};
/* VDS file name */
-static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
/* Dataset names */
-static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
-static char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
+H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
+H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
/* Fill values */
#endif /* VDS_SWMR_H */