summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/test/dsets.c b/test/dsets.c
index b8cd1dc..1ab595d 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -834,8 +834,8 @@ test_compact_io(hid_t fapl)
skipping invalid combinations.
- Create a file, create and write a compact dataset, and verify its data
- Verify the dataset's layout and fill message versions */
- 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)) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds */
H5E_BEGIN_TRY {
@@ -7065,15 +7065,16 @@ static void
make_random_offset_and_increment(long nelts, long *offsetp, long *incp)
{
long inc;
- /* `maxinc` is chosen so that for any `x` in [0, nelts - 1],
- * `x + maxinc` does not overflow a long.
- */
- const long maxinc = MIN(nelts - 1, LONG_MAX - nelts);
HDassert(0 < nelts);
*offsetp = HDrandom() % nelts;
+ /* `maxinc` is chosen so that for any `x` in [0, nelts - 1],
+ * `x + maxinc` does not overflow a long.
+ */
+ const long maxinc = MIN(nelts - 1, LONG_MAX - nelts);
+
/* Choose a random number in [1, nelts - 1]. If its greatest divisor
* in common with `nelts` is 1, then it will "generate" the additive ring
* [0, nelts - 1], so let it be our increment. Otherwise, choose a new
@@ -8418,7 +8419,7 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
H5D_alloc_time_t alloc_time; /* Storage allocation time */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
unsigned ndims; /* Current # of dims to test */
/* Loop over dataspace ranks to test */
@@ -8718,7 +8719,7 @@ test_reopen_chunk_fast(hid_t fapl)
h5_fixname(FILENAME[10], fapl, filename, sizeof filename);
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -8849,7 +8850,7 @@ test_chunk_fast_bug1(hid_t fapl)
if((sid = H5Screate_simple(2, dim, max_dim)) < 0) FAIL_STACK_ERROR
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9027,7 +9028,7 @@ test_chunk_expand(hid_t fapl)
if(TRUE != H5Zfilter_avail(H5Z_FILTER_EXPAND)) FAIL_STACK_ERROR
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9484,7 +9485,7 @@ test_fixed_array(hid_t fapl)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9893,7 +9894,7 @@ test_single_chunk(hid_t fapl)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -10423,8 +10424,8 @@ test_zero_dim_dset(hid_t fapl)
/* Loop through all the combinations of low/high library format bounds,
skipping invalid combination, and verify support for reading a 1D
chunked dataset with dimension size = 0 */
- 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)) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds before opening the file */
H5E_BEGIN_TRY {
@@ -13052,8 +13053,8 @@ test_versionbounds(void)
/* Create a source file and a dataset in it. Create a virtual file and
virtual dataset. Creation of virtual dataset should only succeed in
H5F_LIBVER_V110 */
- 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)) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds, skip for invalid low/high combination */
H5E_BEGIN_TRY {