summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2020-01-28 20:30:20 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-28 20:30:20 (GMT)
commit684a9bd9cbf515a195e9638786b6b1b5b421fe15 (patch)
treef47f71230697119b330b747039457529b6051ce7
parent52115036dd798a59aa89efefe65b74fb679b527c (diff)
parent71c050f837149a0c11e0936e661047c091deaa2f (diff)
downloadhdf5-684a9bd9cbf515a195e9638786b6b1b5b421fe15.zip
hdf5-684a9bd9cbf515a195e9638786b6b1b5b421fe15.tar.gz
hdf5-684a9bd9cbf515a195e9638786b6b1b5b421fe15.tar.bz2
Merge branch 'develop' into misc
-rw-r--r--config/cmake/CTestCustom.cmake27
-rw-r--r--config/cmake/HDFCompilerFlags.cmake7
-rw-r--r--config/gnu-flags4
-rw-r--r--config/sanitizer/sanitizers.cmake2
-rw-r--r--release_docs/INSTALL_Warnings.txt11
-rw-r--r--src/H5private.h25
-rw-r--r--src/H5trace.c2
-rw-r--r--test/cache.c2
-rw-r--r--test/cache_api.c8
-rw-r--r--test/direct_chunk.c2
-rw-r--r--test/dsets.c20
-rw-r--r--test/tattr.c4
-rw-r--r--test/tid.c25
-rw-r--r--testpar/t_cache.c4
-rw-r--r--testpar/t_dset.c27
-rw-r--r--testpar/t_mpi.c4
-rw-r--r--tools/lib/h5diff_array.c200
-rw-r--r--tools/test/h5diff/h5diffgentest.c14
-rw-r--r--tools/test/h5repack/CMakeTests.cmake176
-rw-r--r--tools/test/misc/CMakeTestsMkgrp.cmake37
20 files changed, 260 insertions, 341 deletions
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index 7ee5737..1b8d7d7 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -21,14 +21,17 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION
# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:"
# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument"
# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument"
-# "note.*expected.*void.*but argument is of type.*volatile"
+ "note.*expected.*void.*but argument is of type.*volatile"
# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type"
# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244"
-# "SZIP.src.*:[ \t]*warning"
+ "src.ZLIB.*:[ \t]*warning"
+ "src.SZIP.*:[ \t]*warning"
# "POSIX name for this item is deprecated"
"disabling jobserver mode"
"config.cmake.xlatefile.c"
# "warning.*implicit declaration of function"
+ "warning.*unknown pragma"
+ "warning.*unrecognized .pragma"
# "note: expanded from macro"
# "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro"
)
@@ -69,26 +72,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
HL_FORTRAN_f90_ex-clear-objects
######### tools/h5clear #########
H5CLEAR-clearall-objects
- H5CLEAR-copy_h5clear_fsm_persist_equal.h5
- H5CLEAR-copy_h5clear_fsm_persist_greater.h5
- H5CLEAR-copy_h5clear_fsm_persist_less.h5
- H5CLEAR-copy_h5clear_fsm_persist_noclose.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_less.h5
- H5CLEAR-copy_h5clear_log_v3.h5
- H5CLEAR-copy_h5clear_mdc_image.h5
- H5CLEAR-copy_h5clear_sec2_v0.h5
- H5CLEAR-copy_h5clear_sec2_v2.h5
- H5CLEAR-copy_h5clear_sec2_v3.h5
- H5CLEAR-copy_h5clear_status_noclear.h5
- H5CLEAR-copy_latest_h5clear_log_v3.h5
- H5CLEAR-copy_latest_h5clear_sec2_v3.h5
- H5CLEAR-copy_mod_h5clear_mdc_image.h5
- H5CLEAR-copy_mod_h5clr_mdc_image2.h5
- H5CLEAR-copy_orig_h5clear_sec2_v0.h5
- H5CLEAR-copy_orig_h5clear_sec2_v2.h5
- H5CLEAR-copy_orig_h5clear_sec2_v3.h5
H5CLEAR-h5clear_gentest # does not close ids by design
######### tools/h5copy #########
H5COPY-clearall-objects
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index c803384..99a8f56 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -151,7 +151,12 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
# Append more extra warning flags that only gcc 4.5+ know about
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunsuffixed-float-constants")
+ else ()
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-unsuffixed-float-constants")
+ endif ()
endif ()
# Append more extra warning flags that only gcc 4.6+ know about
diff --git a/config/gnu-flags b/config/gnu-flags
index a5f3258..eaa30a9 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -235,7 +235,9 @@ if test "X-gcc" = "X-$cc_vendor"; then
# gcc 4.5
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
+ H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wunsuffixed-float-constants"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-unsuffixed-float-constants"
fi
# gcc 4.6
diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake
index 7a6c195..2625ec3 100644
--- a/config/sanitizer/sanitizers.cmake
+++ b/config/sanitizer/sanitizers.cmake
@@ -28,7 +28,7 @@ function(append value)
endforeach(variable)
endfunction()
-if(USE_SANITIZER)
+if(USE_SANITIZER AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
append("-fno-omit-frame-pointer" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
diff --git a/release_docs/INSTALL_Warnings.txt b/release_docs/INSTALL_Warnings.txt
index 5fde45f..97b3f76 100644
--- a/release_docs/INSTALL_Warnings.txt
+++ b/release_docs/INSTALL_Warnings.txt
@@ -88,11 +88,13 @@ Autotools UNIX warnings added to H5_CFLAGS
-Waggregate-return
-Wmissing-format-attribute
-Wmissing-noreturn
+ -Wunsuffixed-float-constants (gcc 4.5+)
enable-developer-warnings=OFF
-Wno-inline
-Wno-aggregate-return
-Wno-missing-format-attribute
-Wno-missing-noreturn
+ -Wno-unsuffixed-float-constants (gcc 4.5+)
IF GCC <= 4.3
-Wno-long-long
@@ -128,7 +130,6 @@ IF GCC <= 4.6
-Wstrict-aliasing
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
IF GCC <= 4.7
-Wno-long-long
@@ -141,7 +142,6 @@ IF GCC <= 4.7
-Wstrict-aliasing
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
-Wdouble-promotion
-Wtrampolines
enable-developer-warnings=ON:
@@ -158,7 +158,6 @@ IF GCC <= 4.8
-Wpacked-bitfield-compat
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
-Wdouble-promotion
-Wtrampolines
-Wstack-usage=8192
@@ -205,7 +204,6 @@ IF GCC < 5
-Wpacked-bitfield-compat
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
-Wdouble-promotion
-Wtrampolines
-Wstack-usage=8192
@@ -231,7 +229,6 @@ IF GCC < 6
-Wpacked-bitfield-compat
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
-Wdouble-promotion
-Wtrampolines
-Wstack-usage=8192
@@ -259,7 +256,6 @@ IF GCC < 7
-Wpacked-bitfield-compat
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
-Wdouble-promotion
-Wtrampolines
-Wstack-usage=8192
@@ -322,10 +318,12 @@ IF GNU GCC
HDF5_ENABLE_DEV_WARNINGS=ON
-Winline
-Waggregate-return
+ -Wunsuffixed-float-constants (gcc 4.5+)
HDF5_ENABLE_DEV_WARNINGS=OFF
-Wno-unused-parameter
-Wno-inline
-Wno-aggregate-return
+ -Wno-unsuffixed-float-constants (gcc 4.5+)
========================================================================
@@ -383,7 +381,6 @@ HDF5_ENABLE_GROUPONE_WARNINGS:BOOL=ON
IF GCC >= 4.5
-Wstrict-overflow=5
-Wjump-misses-init
- -Wunsuffixed-float-constants
========================================================================
diff --git a/src/H5private.h b/src/H5private.h
index 74fab79..41cef16 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -534,28 +534,6 @@
#define H5_REQUEST_NULL NULL
/*
- * A macro to portably decrement enumerated types.
- */
-#ifndef H5_DEC_ENUM
-# define H5_DEC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)-1))
-#endif
-
-/* Double constant wrapper
- *
- * Quiets gcc warnings from -Wunsuffixed-float-constants.
- *
- * This is a really annoying warning since the standard specifies that
- * constants of type double do NOT get a suffix so there's no way
- * to specify a constant of type double. To quiet gcc, we specify floating
- * point constants as type long double and cast to double.
- *
- * Note that this macro only needs to be used where using a double
- * is important. For most code, suffixing constants with F will quiet the
- * compiler and not produce erroneous code.
- */
-#define H5_DOUBLE(S) ((double) S ## L)
-
-/*
* Methods to compare the equality of floating-point values:
*
* 1. H5_XXX_ABS_EQUAL - check if the difference is smaller than the
@@ -1032,6 +1010,9 @@ typedef off_t h5_stat_size_t;
#ifndef HDislower
#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/
#endif /* HDislower */
+#ifndef HDisnan
+ #define HDisnan(X) isnan(X)
+#endif /* HDisnan */
#ifndef HDisprint
#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/
#endif /* HDisprint */
diff --git a/src/H5trace.c b/src/H5trace.c
index 4a24804..ec5c6a2 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -155,7 +155,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
} /* end if */
/* Get time for event */
- if(H5_DBL_ABS_EQUAL(first_time.etime, H5_DOUBLE(0.0)))
+ if(H5_DBL_ABS_EQUAL(first_time.etime, 0.0))
H5_timer_begin(&first_time);
if(H5_debug_g.ttimes)
H5_timer_begin(&event_time);
diff --git a/test/cache.c b/test/cache.c
index a90f12b..349d048 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -19914,7 +19914,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* NOTE: upper_hr_threshold MUST be type double (not float)
* or the cache test will fail on 64-bit systems.
*/
- auto_size_ctl.upper_hr_threshold = H5_DOUBLE(0.999); /* for ease of testing */
+ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
auto_size_ctl.decrement = 0.5f;
diff --git a/test/cache_api.c b/test/cache_api.c
index 87d0025..ca2e0ca 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -1664,7 +1664,7 @@ init_invalid_configs(void) {
configs[13].lower_hr_threshold = 1.00000001f;
/* 14 -- increment too small */
- configs[14].increment = H5_DOUBLE(0.999999999999);
+ configs[14].increment = 0.999999999999;
/* 15 -- invalid flash_incr_mode */
configs[15].flash_incr_mode = (enum H5C_cache_flash_incr_mode)-1;
@@ -1697,7 +1697,7 @@ init_invalid_configs(void) {
/* 23 -- decrement too big */
configs[23].decr_mode = H5C_decr__threshold;
- configs[23].decrement = H5_DOUBLE(1.0000000001);
+ configs[23].decrement = 1.0000000001;
/* 24 -- epochs_before_eviction too small */
configs[24].epochs_before_eviction = 0;
@@ -1709,13 +1709,13 @@ init_invalid_configs(void) {
configs[26].empty_reserve = -0.0000000001f;
/* 27 -- empty_reserve too big */
- configs[27].empty_reserve = H5_DOUBLE(1.00000000001);
+ configs[27].empty_reserve = 1.00000000001;
/* 28 -- upper_hr_threshold too small */
configs[28].upper_hr_threshold = -0.000000001f;
/* 29 -- upper_hr_threshold too big */
- configs[29].upper_hr_threshold = H5_DOUBLE(1.00000001);
+ configs[29].upper_hr_threshold = 1.00000001;
/* 30 -- upper_hr_threshold <= lower_hr_threshold */
configs[30].lower_hr_threshold = 0.9f;
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index 6cf27c8..2e6cc68 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -43,7 +43,7 @@
#define CHUNK_NX 4
#define CHUNK_NY 4
-#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0))
+#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*1.001)+12.0)
/* Temporary filter IDs used for testing */
#define H5Z_FILTER_BOGUS1 305
diff --git a/test/dsets.c b/test/dsets.c
index bbe2d0f..9926f10 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -3168,18 +3168,18 @@ test_nbit_double(hid_t file)
*/
double orig_data[2][5] = {
{
- H5_DOUBLE(1.6081706885101836e+60),
- H5_DOUBLE(-255.32099170994480),
- H5_DOUBLE(1.2677579992621376e-61),
- H5_DOUBLE(64568.289448797700),
- H5_DOUBLE(-1.0619721778839084e-75)
+ 1.6081706885101836e+60,
+ -255.32099170994480,
+ 1.2677579992621376e-61,
+ 64568.289448797700,
+ -1.0619721778839084e-75
},
{
- H5_DOUBLE(2.1499497833454840e+56),
- H5_DOUBLE(6.6562295504670740e-3),
- H5_DOUBLE(-1.5747263393432150),
- H5_DOUBLE(1.0711093225222612),
- H5_DOUBLE(-9.8971679387636870e-1)
+ 2.1499497833454840e+56,
+ 6.6562295504670740e-3,
+ -1.5747263393432150,
+ 1.0711093225222612,
+ -9.8971679387636870e-1
}};
double new_data[2][5];
size_t precision, offset;
diff --git a/test/tattr.c b/test/tattr.c
index bcd8698..dab03a7 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -542,7 +542,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!H5_DBL_ABS_EQUAL(rdata, H5_DOUBLE(0.0)))
+ if(!H5_DBL_ABS_EQUAL(rdata, 0.0))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Fflush(fil, H5F_SCOPE_GLOBAL);
@@ -551,7 +551,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!H5_DBL_ABS_EQUAL(rdata, H5_DOUBLE(0.0)))
+ if(!H5_DBL_ABS_EQUAL(rdata, 0.0))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
diff --git a/test/tid.c b/test/tid.c
index d0ae3e4..7a839d2 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -19,6 +19,13 @@
#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)
{
@@ -69,7 +76,7 @@ static int basic_id_test(void)
goto out;
/* Register a type */
- myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -163,7 +170,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, (H5I_free_t) free );
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -238,7 +245,7 @@ out:
/* A dummy search function for the next test */
-static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; }
+static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; }
/* Ensure that public functions cannot access "predefined" ID types */
static int id_predefined_test(void )
@@ -264,7 +271,7 @@ static int id_predefined_test(void )
goto out;
H5E_BEGIN_TRY
- testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
+ testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj);
H5E_END_TRY
CHECK_PTR_NULL(testPtr, "H5Isearch");
@@ -492,7 +499,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, (H5I_free_t) free );
+ startType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(startType, H5I_BADID, "H5Iregister_type");
if(startType == H5I_BADID)
goto out;
@@ -507,7 +514,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, (H5I_free_t) free );
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -516,7 +523,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, (H5I_free_t) free );
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -524,7 +531,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, (H5I_free_t) free );
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
H5E_END_TRY
VERIFY(testType, H5I_BADID, "H5Iregister_type");
@@ -533,7 +540,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, (H5I_free_t) free );
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
if(testType != H5I_NTYPES)
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 09d2ecc..954071d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -4671,7 +4671,7 @@ verify_entry_reads(haddr_t addr,
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_reads != expected_entry_reads ) {
@@ -4778,7 +4778,7 @@ verify_entry_writes(haddr_t addr,
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_writes != expected_entry_writes ) {
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 05baf3f..13f9e89 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -80,7 +80,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[0] : 0);
+ start[0] = (mpi_rank ? (hsize_t)mpi_rank * block[0] : 0);
start[1] = 0;
if (VERBOSE_MED)
HDprintf("slab_set ZROW\n");
@@ -90,11 +90,11 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
block[0] = (hsize_t)dim0;
block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0);
stride[0] = block[0];
- stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
+ stride[1] = (hsize_t)(mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[1] : 0);
+ start[1] = (mpi_rank ? (hsize_t)mpi_rank * block[1] : 0);
if (VERBOSE_MED)
HDprintf("slab_set ZCOL\n");
break;
@@ -1115,7 +1115,7 @@ dataset_readAll(void)
/* set up the coords array selection */
num_points = (size_t)dim1;
- coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * (size_t)RANK * sizeof(hsize_t));
+ coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
@@ -1416,7 +1416,7 @@ dataset_readAll(void)
ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all succeeded");
- H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int);
+ num_points = (size_t)(dim0 * dim1);
k=0;
for (i=0 ; i<dim0; i++) {
for (j=0 ; j<dim1; j++) {
@@ -1839,6 +1839,7 @@ extend_writeInd2(void)
/* -------------------------
* Write to the second half of the dataset
* -------------------------*/
+ H5_CHECK_OVERFLOW(orig_size, hsize_t, int);
for (i=0; i<(int)orig_size; i++)
written[i] = (int)orig_size + i;
MESG("data array re-initialized");
@@ -2545,7 +2546,7 @@ compress_readAll(void)
/* Initialize data buffers */
for(u=0; u<dim;u++)
- data_orig[u]=(int)u;
+ data_orig[u]=(DATATYPE)u;
/* Run test both with and without filters disabled on partial chunks */
for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1;
@@ -3913,7 +3914,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
length = dim0 * dim1;
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
+ buffer = (int *)HDmalloc(sizeof(int) * length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -4337,20 +4338,22 @@ dataset_atomicity(void)
compare = 5;
+ H5_CHECK_OVERFLOW(block[0], hsize_t, int);
+ H5_CHECK_OVERFLOW(block[1], hsize_t, int);
for (i=0 ; i<dim0 ; i++) {
- if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) {
+ if (i >= mpi_rank*((int)block[0]+1)) {
break;
}
- if (((hsize_t)i+1)%(block[0]+1)==0) {
+ if ((i+1)%((int)block[0]+1)==0) {
k += dim1;
continue;
}
for (j=0 ; j<dim1 ; j++) {
- if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) {
- H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1), hsize_t);
+ if (j >= mpi_rank*((int)block[1]+1)) {
+ k += dim1 - mpi_rank*((int)block[1]+1);
break;
}
- if (((hsize_t)j+1)%(block[1]+1)==0) {
+ if ((j+1)%((int)block[1]+1)==0) {
k++;
continue;
}
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 064fb57..670e02b 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -303,7 +303,7 @@ static int test_mpio_gb_file(char *filename) {
mpi_rank, mpi_off, mpi_off);
/* set data to some trivial pattern for easy verification */
for (j = 0; j < MB; j++)
- H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int);
+ *(buf + j) = (int8_t)(i * mpi_size + mpi_rank);
if (VERBOSE_MED)
HDfprintf(stdout,
"proc %d: writing %d bytes at offset %lld\n",
@@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) {
mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
&mpi_stat);
INFO((mrc == MPI_SUCCESS), "GB size file read");
- H5_CHECKED_ASSIGN(expected, int8_t, i * mpi_size + (mpi_size - mpi_rank - 1), int);
+ expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1));
vrfyerrs = 0;
for (j = 0; j < MB; j++) {
if ((*(buf + j) != expected)
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 6cfe3d2..6450745 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -243,7 +243,6 @@ typedef enum dtype_t {
} dtype_t;
#endif
-static hbool_t my_isnan(dtype_t type, void *val);
/*-------------------------------------------------------------------------
* XCAO, 11/10/2010
@@ -1759,8 +1758,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
@@ -1794,8 +1793,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
@@ -1840,8 +1839,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
@@ -1917,8 +1916,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -1952,8 +1951,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -1997,8 +1996,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -2078,8 +2077,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -2113,8 +2112,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -2158,8 +2157,8 @@ static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -2633,8 +2632,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
@@ -2678,8 +2677,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
if ((!isnan1 && !isnan2)) {
@@ -2733,8 +2732,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
- isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
+ isnan1 = HDisnan(temp1_float);
+ isnan2 = HDisnan(temp2_float);
}
/* both not NaN, do the comparison */
@@ -2843,8 +2842,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -2889,8 +2888,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
@@ -2945,8 +2944,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -3062,8 +3061,8 @@ static hsize_t diff_ldouble(unsigned char *mem1,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -3108,8 +3107,8 @@ static hsize_t diff_ldouble(unsigned char *mem1,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
@@ -3162,8 +3161,8 @@ static hsize_t diff_ldouble(unsigned char *mem1,
*-------------------------------------------------------------------------
*/
if (opts->do_nans) {
- isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
- isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
+ isnan1 = HDisnan(temp1_double);
+ isnan2 = HDisnan(temp2_double);
}
/* both not NaN, do the comparison */
@@ -4541,8 +4540,8 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *opts) {
* detect NaNs
*-------------------------------------------------------------------------
*/
- hbool_t isnan1 = my_isnan(FLT_DOUBLE, &value);
- hbool_t isnan2 = my_isnan(FLT_DOUBLE, &expected);
+ hbool_t isnan1 = HDisnan(value);
+ hbool_t isnan2 = HDisnan(expected);
/*-------------------------------------------------------------------------
* we consider NaN == NaN to be true
@@ -4559,12 +4558,16 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *opts) {
return FALSE;
}
- if (H5_DBL_ABS_EQUAL(value, expected))
- return TRUE;
-
- if (opts->use_system_epsilon)
- if (ABS((value-expected)) < DBL_EPSILON)
+ if (opts->use_system_epsilon) {
+ /* Check equality within some epsilon */
+ if (H5_DBL_ABS_EQUAL(value, expected))
+ return TRUE;
+ }
+ else {
+ /* Check bits */
+ if (!HDmemcmp(&value, &expected, sizeof(double)))
return TRUE;
+ }
return FALSE;
}
@@ -4585,8 +4588,8 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts)
* detect NaNs
*-------------------------------------------------------------------------
*/
- hbool_t isnan1 = my_isnan(FLT_LDOUBLE, &value);
- hbool_t isnan2 = my_isnan(FLT_LDOUBLE, &expected);
+ hbool_t isnan1 = HDisnan(value);
+ hbool_t isnan2 = HDisnan(expected);
/*-------------------------------------------------------------------------
* we consider NaN == NaN to be true
@@ -4603,12 +4606,16 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts)
return FALSE;
}
- if (H5_LDBL_ABS_EQUAL(value, expected))
- return TRUE;
-
- if (opts->use_system_epsilon)
- if (ABS((value-expected)) < DBL_EPSILON)
+ if (opts->use_system_epsilon) {
+ /* Check equality within some epsilon */
+ if (H5_LDBL_ABS_EQUAL(value, expected))
return TRUE;
+ }
+ else {
+ /* Check bits */
+ if (!HDmemcmp(&value, &expected, sizeof(long double)))
+ return TRUE;
+ }
return FALSE;
}
@@ -4627,8 +4634,8 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) {
* detect NaNs
*-------------------------------------------------------------------------
*/
- hbool_t isnan1 = my_isnan(FLT_FLOAT, &value);
- hbool_t isnan2 = my_isnan(FLT_FLOAT, &expected);
+ hbool_t isnan1 = HDisnan(value);
+ hbool_t isnan2 = HDisnan(expected);
/*-------------------------------------------------------------------------
* we consider NaN == NaN to be true
@@ -4645,90 +4652,21 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) {
return FALSE;
}
- if (H5_FLT_ABS_EQUAL(value, expected))
- return TRUE;
-
- if (opts->use_system_epsilon)
- if (ABS( (value-expected) ) < FLT_EPSILON)
+ if (opts->use_system_epsilon) {
+ /* Check equality within some epsilon */
+ if (H5_FLT_ABS_EQUAL(value, expected))
return TRUE;
-
- return FALSE;
-}
-
-/*-------------------------------------------------------------------------
- * Function: my_isnan
- *
- * Purpose: Determines whether VAL points to NaN.
- *
- * Return: TRUE or FALSE
- *-------------------------------------------------------------------------
- */
-static hbool_t my_isnan(dtype_t type, void *val) {
- hbool_t retval = FALSE;
- char s[256];
-
- if (FLT_FLOAT == type) {
- float x;
-
- HDmemcpy(&x, val, sizeof(float));
- retval = (x != x);
}
- else if (FLT_DOUBLE == type) {
- 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;
-
- HDmemcpy(&x, val, sizeof(long double));
- retval = (x!=x);
- }
-#endif
- else
- return FALSE;
-
- /*
- * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if
- * the result contains a NaN string.
- */
- if (!retval) {
- if (FLT_FLOAT == type) {
- float x;
-
- HDmemcpy(&x, val, sizeof(float));
- HDsnprintf(s, sizeof(s), "%g", (double) x);
- }
- else if (FLT_DOUBLE == type) {
- 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;
-
- HDmemcpy(&x, val, sizeof(long double));
- HDsnprintf(s, sizeof(s), "%Lg", x);
- }
-#endif
- else
- return FALSE;
-
- if (HDstrstr(s, "NaN") ||
- HDstrstr(s, "NAN") ||
- HDstrstr(s, "nan") ||
- HDstrstr(s, "-1.#IND")) {
- retval = TRUE;
- }
+ else {
+ /* Check bits */
+ if (!HDmemcmp(&value, &expected, sizeof(float)))
+ return TRUE;
}
- return retval;
+ return FALSE;
}
+
/*-------------------------------------------------------------------------
*
* Local functions
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index 98001ff..1d5354f 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -432,14 +432,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/* epsilon = 0.0000000000000001 = 1e-16
* system epsilon for double : DBL_EPSILON = 2.22045E-16
*/
- double data13[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE(
- 0.0000000000000001) }, { H5_DOUBLE(0.0000000000000001),
- H5_DOUBLE(0.0000000000000000) }, { H5_DOUBLE(
- 0.00000000000000033), H5_DOUBLE(0.0000000000000001) } };
- double data14[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE(
- 0.0000000000000004) }, { H5_DOUBLE(0.0000000000000002),
- H5_DOUBLE(0.0000000000000001) }, { H5_DOUBLE(
- 0.0000000000000001), H5_DOUBLE(0.00000000000000000) } };
+ double data13[3][2] = { { 0.0000000000000000, 0.0000000000000001 },
+ { 0.0000000000000001, 0.0000000000000000 },
+ { 0.00000000000000033, 0.0000000000000001 } };
+ double data14[3][2] = { { 0.0000000000000000, 0.0000000000000004 },
+ { 0.0000000000000002, 0.0000000000000001 },
+ { 0.0000000000000001, 0.00000000000000000 } };
write_dset(gid1, 2, dims2, "fp1", H5T_NATIVE_FLOAT, data11);
write_dset(gid1, 2, dims2, "fp2", H5T_NATIVE_FLOAT, data12);
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index 0c761e2..aa99d04 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -725,100 +725,100 @@
endmacro ()
macro (ADD_H5_EXTERNAL_TEST testname testtype testfile)
- # canonical file = h5repack_${testfile}.h5 - preexist
- # external file = h5repack_${testfile}_ex.h5 - preexist
- # repacked file = h5repack_${testfile}_rp.h5 - created
- # external data file = h5repack_${testfile}_ex-0.dat
- if ("${testtype}" STREQUAL "SKIP")
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # canonical file = h5repack_${testfile}.h5 - preexist
+ # external file = h5repack_${testfile}_ex.h5 - preexist
+ # repacked file = h5repack_${testfile}_rp.h5 - created
+ # external data file = h5repack_${testfile}_ex-0.dat
+ if ("${testtype}" STREQUAL "SKIP")
add_test (
NAME H5REPACK_EXTERNAL-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED)
+ else ()
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ # make sure external data file 0 is available
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_CPY
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
+ )
+ # comparison of known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF1
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
+ )
+ # repack the external file to the repacked file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
+ )
+ # comparison of repacked file to known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}
+ )
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF3
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
+ )
+ # invalidate external file by removing its first data file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
+ )
+ # verify comparison of repacked file to known file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF4
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ )
+ # verify comparison of repacked file to known external file fails
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
+ WILL_FAIL "true"
+ )
endif ()
- else ()
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- FIXTURES_REQUIRED clear_h5repack
- )
- # make sure external data file 0 is available
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_CPY
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
- )
- # comparison of known files
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF1
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
- )
- # repack the external file to the repacked file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
- )
- # comparison of repacked file to known files
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF2
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}
- )
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF3
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
- )
- # invalidate external file by removing its first data file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
- COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
- )
- # verify comparison of repacked file to known file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF4
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
- )
- # verify comparison of repacked file to known external file fails
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
- WILL_FAIL "true"
- )
endif ()
endmacro ()
diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake
index c947e0e..75cafb7 100644
--- a/tools/test/misc/CMakeTestsMkgrp.cmake
+++ b/tools/test/misc/CMakeTestsMkgrp.cmake
@@ -61,22 +61,27 @@
endif ()
macro (ADD_H5_TEST resultfile resultcode resultoption)
- add_test (
- NAME H5MKGRP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
- )
- set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- )
- add_test (
- NAME H5MKGRP-${resultfile}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
- )
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
- DEPENDS H5MKGRP-${resultfile}-clear-objects
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- )
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5MKGRP-${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
+ )
+ else ()
+ add_test (
+ NAME H5MKGRP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ add_test (
+ NAME H5MKGRP-${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
+ )
+ set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP-${resultfile}-clear-objects
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
add_test (
NAME H5MKGRP-${resultfile}-h5ls
COMMAND "${CMAKE_COMMAND}"