summaryrefslogtreecommitdiffstats
path: root/tools/test/h5stat
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-02-11 20:28:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-02-11 20:28:56 (GMT)
commit4ec2df9ac08f0c28eb32211c3cb0139a73f82981 (patch)
tree5fd3daa9f8168cfb46902bd62ad070c6639796de /tools/test/h5stat
parentbd5d6e4e772fe557ab52f881df17f73a4028184b (diff)
downloadhdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.zip
hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.gz
hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.bz2
Merge from dev, sanitizer, fortran, warnings and tools ids
Diffstat (limited to 'tools/test/h5stat')
-rw-r--r--tools/test/h5stat/CMakeTests.cmake14
-rw-r--r--tools/test/h5stat/h5stat_gentest.c56
2 files changed, 32 insertions, 38 deletions
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index 9674a77..0c07418 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -93,16 +93,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -111,7 +105,7 @@
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -125,7 +119,7 @@
macro (ADD_H5_ERR_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -134,7 +128,7 @@
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index 2edfcf6..0bf1001 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -54,14 +54,14 @@
static void
gen_newgrat_file(const char *fname)
{
- hid_t fcpl = -1; /* File creation property */
- hid_t fapl = -1; /* File access property */
- hid_t fid = -1; /* File id */
- hid_t gid = -1; /* Group id */
- hid_t tid = -1; /* Datatype id */
- hid_t sid = -1; /* Dataspace id */
- hid_t attr_id = -1; /* Attribute id */
- hid_t did = -1; /* Dataset id */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property */
+ hid_t fapl = H5I_INVALID_HID; /* File access property */
+ hid_t fid = H5I_INVALID_HID; /* File id */
+ hid_t gid = H5I_INVALID_HID; /* Group id */
+ hid_t tid = H5I_INVALID_HID; /* Datatype id */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace id */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute id */
+ hid_t did = H5I_INVALID_HID; /* Dataset id */
char name[30]; /* Group name */
char attrname[30]; /* Attribute name */
int i; /* Local index variable */
@@ -139,15 +139,15 @@ error:
static void
gen_threshold_file(const char *fname)
{
- hid_t fid = -1; /* File ID */
- hid_t sid0 = -1; /* Dataspace IDs */
- hid_t sid1 = -1; /* Dataspace IDs */
- hid_t sid2 = -1; /* Dataspace IDs */
- hid_t sid3 = -1; /* Dataspace IDs */
- hid_t sid4 = -1; /* Dataspace IDs */
- hid_t did = -1; /* Dataset ID */
- hid_t attr_id = -1; /* Attribute ID */
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t sid0 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid1 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid2 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid3 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid4 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
hsize_t two_dims[] = {2, 5}; /* Dimension array */
hsize_t one_dims[] = {6}; /* Dimension array */
hsize_t zero_dims[] = {0}; /* Dimension array */
@@ -323,11 +323,11 @@ error:
static void
gen_idx_file(const char *fname)
{
- hid_t fapl = -1; /* file access property id */
- hid_t fid = -1; /* file id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did = -1, did2 = -1; /* dataset id */
+ hid_t fapl = H5I_INVALID_HID; /* file access property id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did = -1, did2 = H5I_INVALID_HID; /* dataset id */
hsize_t dims[1] = {10}; /* dataset dimension */
hsize_t c_dims[1] = {2}; /* chunk dimension */
int i; /* local index variable */
@@ -413,12 +413,12 @@ error:
static void
gen_err_refcount(const char *fname)
{
- hid_t fid = -1; /* File identifier */
- hid_t sid = -1; /* Dataspace message */
- hid_t did = -1; /* Dataset identifier */
- hid_t gid = -1; /* Group identifier */
- hid_t aid1 = -1, aid2 = -1; /* Attribute identifier */
- hid_t tid = -1; /* Datatype identifier */
+ hid_t fid = H5I_INVALID_HID; /* File identifier */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace message */
+ hid_t did = H5I_INVALID_HID; /* Dataset identifier */
+ hid_t gid = H5I_INVALID_HID; /* Group identifier */
+ hid_t aid1 = -1, aid2 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
int i, n; /* Local index variables */
int buf[10]; /* Data buffer */
hsize_t dims[1]; /* Dimension size */