summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-04-11 19:07:14 (GMT)
committerGitHub <noreply@github.com>2023-04-11 19:07:14 (GMT)
commit281071907b9744ed4d560343bb6fe052efdf497b (patch)
treef62ff326c77bebefcd68091b82377ef0cefec016 /test
parent92177ef21e37ae4b3c88c539f1639d90aa7ebcf6 (diff)
downloadhdf5-281071907b9744ed4d560343bb6fe052efdf497b.zip
hdf5-281071907b9744ed4d560343bb6fe052efdf497b.tar.gz
hdf5-281071907b9744ed4d560343bb6fe052efdf497b.tar.bz2
Remove -Wunused-but-set-variable warnings in tests (#2661)
Diffstat (limited to 'test')
-rw-r--r--test/dt_arith.c4
-rw-r--r--test/tattr.c8
-rw-r--r--test/twriteorder.c25
3 files changed, 6 insertions, 31 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index aa0115e..c006c49 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -2799,7 +2799,6 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
unsigned char *hw = NULL; /*ptr to hardware-conv'd*/
int underflow; /*underflow occurred */
int overflow = 0; /*overflow occurred */
- int uflow = 0; /*underflow debug counters*/
size_t j, k; /*counters */
int sendian; /* source type endianness */
int dendian; /* Destination type endianness */
@@ -3089,9 +3088,6 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
}
#endif
}
- if (underflow) {
- uflow++;
- }
/* For Intel machines, the size of "long double" is 12 bytes, precision
* is 80 bits; for Intel IA64 and AMD processors, the size of "long double"
diff --git a/test/tattr.c b/test/tattr.c
index 5d82234..5dd5736 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -7082,7 +7082,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx
if (iter_info->visited[v] == TRUE)
nvisit++;
- VERIFY(skip, (max_attrs / 2), "H5Aiterate2");
+ VERIFY(nvisit, max_attrs, "H5Aiterate2");
} /* end else */
/* Skip over some attributes on object */
@@ -7113,7 +7113,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx
if (iter_info->visited[v] == TRUE)
nvisit++;
- VERIFY(skip, (max_attrs / 2), "H5Aiterate_by_name");
+ VERIFY(nvisit, max_attrs, "H5Aiterate_by_name");
} /* end else */
/* Skip over some attributes on object */
@@ -7144,7 +7144,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx
if (iter_info->visited[v] == TRUE)
nvisit++;
- VERIFY(skip, (max_attrs / 2), "H5Aiterate_by_name");
+ VERIFY(nvisit, max_attrs, "H5Aiterate_by_name");
} /* end else */
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -7176,7 +7176,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx
if (iter_info->visited[v] == TRUE)
nvisit++;
- VERIFY(skip, (max_attrs / 2), "H5Aiterate1");
+ VERIFY(nvisit, max_attrs, "H5Aiterate1");
} /* end else */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/test/twriteorder.c b/test/twriteorder.c
index c7984e7..165abcf 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -273,9 +273,6 @@ write_wo_file(void)
HDmemset(&buffer[4], i & 0xff, (size_t)(BLOCKSIZE_DFT - 4));
/* write the block */
-#ifdef DEBUG
- HDprintf("writing block at %d\n", blkaddr);
-#endif
HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET);
if ((bytes_wrote = HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g) {
HDprintf("blkaddr write failed in partition %d\n", i);
@@ -295,9 +292,6 @@ write_wo_file(void)
}
/* all writes done. return success. */
-#ifdef DEBUG
- HDprintf("wrote %d blocks\n", nlinkedblock_g);
-#endif
return 0;
}
@@ -305,9 +299,8 @@ int
read_wo_file(void)
{
int read_fd;
- int blkaddr = 0;
- h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
- int linkedblocks_read = 0;
+ int blkaddr = 0;
+ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
char buffer[BLOCKSIZE_DFT];
/* Open the data file */
@@ -324,30 +317,19 @@ read_wo_file(void)
return -1;
}
}
- linkedblocks_read++;
/* got a non-zero blkaddr. Proceed down the linked blocks. */
-#ifdef DEBUG
- HDprintf("got initial block address=%d\n", blkaddr);
-#endif
while (blkaddr != 0) {
HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET);
if ((bytes_read = HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g) {
HDprintf("blkaddr read failed in partition %d\n", 0);
return -1;
}
- linkedblocks_read++;
/* retrieve the block address in byte 0-3 */
HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr));
-#ifdef DEBUG
- HDprintf("got next block address=%d\n", blkaddr);
-#endif
}
-#ifdef DEBUG
- HDprintf("read %d blocks\n", linkedblocks_read);
-#endif
return 0;
}
@@ -426,9 +408,6 @@ main(int argc, char *argv[])
/* launch writer */
/* ============= */
/* this process continues to launch the writer */
-#ifdef DEBUG
- HDprintf("%d: continue as the writer process\n", mypid);
-#endif
if (write_wo_file() < 0) {
HDfprintf(stderr, "write_wo_file encountered error\n");
Hgoto_error(1);