summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/accum.c118
-rw-r--r--test/links.c11
-rw-r--r--test/objcopy.c54
-rw-r--r--test/ohdr.c8
4 files changed, 97 insertions, 94 deletions
diff --git a/test/accum.c b/test/accum.c
index 268b7e1..edfc751 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -164,7 +164,7 @@ test_write_read(const H5F_io_info_t *fio_info)
/* Allocate buffers */
write_buf = (int *)HDmalloc(1024 * sizeof(int));
HDassert(write_buf);
- read_buf = (int *)HDcalloc(1024, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)1024, sizeof(int));
HDassert(read_buf);
/* Fill buffer with data, zero out read buffer */
@@ -175,7 +175,7 @@ test_write_read(const H5F_io_info_t *fio_info)
/* Write 1KB at Address 0 */
if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR;
if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR;
+ if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -220,7 +220,7 @@ test_write_read_nonacc_front(const H5F_io_info_t *fio_info)
/* Allocate buffers */
write_buf = (int *)HDmalloc(2048 * sizeof(int));
HDassert(write_buf);
- read_buf = (int *)HDcalloc(2048, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)2048, sizeof(int));
HDassert(read_buf);
/* Fill buffer with data, zero out read buffer */
@@ -234,7 +234,7 @@ test_write_read_nonacc_front(const H5F_io_info_t *fio_info)
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR;
if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR;
+ if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -279,7 +279,7 @@ test_write_read_nonacc_end(const H5F_io_info_t *fio_info)
/* Allocate buffers */
write_buf = (int *)HDmalloc(2048 * sizeof(int));
HDassert(write_buf);
- read_buf = (int *)HDcalloc(2048, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)2048, sizeof(int));
HDassert(read_buf);
/* Fill buffer with data, zero out read buffer */
@@ -293,7 +293,7 @@ test_write_read_nonacc_end(const H5F_io_info_t *fio_info)
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR;
if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR;
+ if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -525,7 +525,7 @@ test_accum_overlap(const H5F_io_info_t *fio_info)
/* Allocate buffers */
wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t));
+ rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
HDassert(rbuf);
/* Case 1: No metadata in accumulator */
@@ -697,7 +697,7 @@ test_accum_overlap_clean(const H5F_io_info_t *fio_info)
/* Allocate buffers */
wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t));
+ rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
HDassert(rbuf);
/* Case 1: No metadata in accumulator */
@@ -876,7 +876,7 @@ test_accum_non_overlap_size(const H5F_io_info_t *fio_info)
/* Allocate buffers */
wbuf = (int *)HDmalloc(4096 * sizeof(int32_t));
HDassert(wbuf);
- rbuf = (int *)HDcalloc(4096, sizeof(int32_t));
+ rbuf = (int *)HDcalloc((size_t)4096, sizeof(int32_t));
HDassert(rbuf);
/* Case 1: No metadata in accumulator */
@@ -943,7 +943,7 @@ test_accum_overlap_size(const H5F_io_info_t *fio_info)
/* Allocate buffers */
wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t));
+ rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
HDassert(rbuf);
/* Case 1: No metadata in accumulator */
@@ -1050,11 +1050,11 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read back and verify first write */
if(accum_read((1024 * 1024), (1024 * 1024) - 1, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, (1024 * 1024) - 1) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)((1024 * 1024) - 1)) != 0) TEST_ERROR;
/* Read back and verify second write */
if(accum_read((1024 * 1024) - 1024, 1024, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
/* Reset accumulator for next case */
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1080,10 +1080,10 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read back and verify both pieces of data */
if(accum_read(1048576, 1048575, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 1048576) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)1048576) != 0) TEST_ERROR;
if(accum_read(5, 1048571, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 1048571) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0) TEST_ERROR;
/* Reset accumulator for next case */
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1118,7 +1118,7 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read((1024 * 1024) - 1, 1024, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
/* Reset accumulator for next case */
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1158,7 +1158,7 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR;
/* Reset accumulator for next case */
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1195,7 +1195,7 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read((1024 * 1024) - 5, 10, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 10) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR;
/* Reset accumulator for next case */
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1227,7 +1227,7 @@ test_accum_adjust(const H5F_io_info_t *fio_info)
/* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1310,7 +1310,7 @@ test_read_after(const H5F_io_info_t *fio_info)
/* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR;
- if(HDmemcmp(wbuf, rbuf, 128) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1352,13 +1352,13 @@ test_big(const H5F_io_info_t *fio_info)
unsigned u; /* Local index variable */
/* Allocate space for the write & read buffers */
- wbuf = (uint8_t *)HDmalloc(BIG_BUF_SIZE);
+ wbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE);
HDassert(wbuf);
- wbuf2 = (uint8_t *)HDmalloc(BIG_BUF_SIZE);
+ wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE);
HDassert(wbuf2);
- rbuf = (uint8_t *)HDcalloc(BIG_BUF_SIZE + 1536, 1);
+ rbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
HDassert(rbuf);
- zbuf = (uint8_t *)HDcalloc(BIG_BUF_SIZE + 1536, 1);
+ zbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
HDassert(zbuf);
/* Initialize write buffers */
@@ -1376,12 +1376,12 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE);
+ HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1393,14 +1393,14 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(zbuf, rbuf, 1024) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf, rbuf + 1024, 1024) != 0) TEST_ERROR;
- if(HDmemcmp(zbuf, rbuf + 2048, (BIG_BUF_SIZE - 2048)) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf + 1024, (size_t)1024) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf + 2048, (size_t)(BIG_BUF_SIZE - 2048)) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE);
+ HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1412,13 +1412,13 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(zbuf, rbuf, (BIG_BUF_SIZE - 512)) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf, rbuf + (BIG_BUF_SIZE - 512), 512) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf, (size_t)(BIG_BUF_SIZE - 512)) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf + (BIG_BUF_SIZE - 512), (size_t)512) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE);
+ HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1430,13 +1430,13 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(512, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf + 512, rbuf, 512) != 0) TEST_ERROR;
- if(HDmemcmp(zbuf, rbuf + 512, (BIG_BUF_SIZE - 512)) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf + 512, rbuf, (size_t)512) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf + 512, (size_t)(BIG_BUF_SIZE - 512)) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE);
+ HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1453,12 +1453,12 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE);
+ HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1475,13 +1475,13 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf + 512, rbuf + BIG_BUF_SIZE, 512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf + 512, rbuf + BIG_BUF_SIZE, (size_t)512) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE + 512);
+ HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1502,14 +1502,14 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 1024, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR;
- if(HDmemcmp(zbuf, rbuf + BIG_BUF_SIZE, 512) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf, rbuf + BIG_BUF_SIZE + 512, 512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf + BIG_BUF_SIZE, (size_t)512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf + BIG_BUF_SIZE + 512, (size_t)512) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE + 1024);
+ HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024));
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1531,13 +1531,13 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 1536, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(zbuf, rbuf, 1536) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf2, rbuf + 1536, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf, (size_t)1536) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536);
+ HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1558,13 +1558,13 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(zbuf, rbuf, 512) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf2, rbuf + 512, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf, (size_t)512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE + 512);
+ HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1585,14 +1585,14 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 1536, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR;
- if(HDmemcmp(zbuf, rbuf + 1024, 512) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf2, rbuf + 1536, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
+ if(HDmemcmp(zbuf, rbuf + 1024, (size_t)512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR;
- HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536);
+ HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1613,8 +1613,8 @@ test_big(const H5F_io_info_t *fio_info)
if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read */
- if(HDmemcmp(wbuf, rbuf, 512) != 0) TEST_ERROR;
- if(HDmemcmp(wbuf2, rbuf + 512, BIG_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)512) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
@@ -1666,9 +1666,9 @@ test_random_write(const H5F_io_info_t *fio_info)
unsigned u; /* Local index variable */
/* Allocate space for the write & read buffers */
- wbuf = (uint8_t *)HDmalloc(RANDOM_BUF_SIZE);
+ wbuf = (uint8_t *)HDmalloc((size_t)RANDOM_BUF_SIZE);
HDassert(wbuf);
- rbuf = (uint8_t *)HDcalloc(RANDOM_BUF_SIZE, 1);
+ rbuf = (uint8_t *)HDcalloc((size_t)RANDOM_BUF_SIZE, (size_t)1);
HDassert(rbuf);
/* Initialize write buffer */
@@ -1752,7 +1752,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
if(accum_read(RANDOM_BASE_OFF, RANDOM_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR;
/* Verify data read back in */
- if(HDmemcmp(wbuf, rbuf, RANDOM_BUF_SIZE) != 0) TEST_ERROR;
+ if(HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0) TEST_ERROR;
if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
diff --git a/test/links.c b/test/links.c
index db5922b..2886304 100644
--- a/test/links.c
+++ b/test/links.c
@@ -3848,7 +3848,6 @@ external_set_elink_fapl3(hbool_t new_format)
{
hid_t core_fapl = -1, stdio_fapl = -1;
hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl;
- int ret;
if(new_format)
TESTING("H5Pset/get_fapl() (w/new group format)")
@@ -3907,11 +3906,11 @@ external_set_elink_fapl3(hbool_t new_format)
error:
H5E_BEGIN_TRY {
- H5Pclose(l_fapl);
- H5Pclose(lapl_id);
- H5Pclose(new_lapl_id);
- H5Pclose(core_fapl);
- H5Pclose(stdio_fapl);
+ H5Pclose(l_fapl);
+ H5Pclose(lapl_id);
+ H5Pclose(new_lapl_id);
+ H5Pclose(core_fapl);
+ H5Pclose(stdio_fapl);
} H5E_END_TRY;
return -1;
} /* end external_set_elink_fapl3() */
diff --git a/test/objcopy.c b/test/objcopy.c
index 82be446..f3806cd 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -1243,12 +1243,11 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
if(offset1 != offset2) TEST_ERROR
if(size1 != size2) TEST_ERROR
- if(strcmp(name1, name2) != 0) TEST_ERROR
+ if(HDstrcmp(name1, name2) != 0) TEST_ERROR
}
- /* Remove external file information from the dcpls */
-
- /* reset external file information from the dcpls */
+ /* Reset external file information from the dcpls */
+ /* (Directly removing default property causes memory leak) */
if (H5P_reset_external_file_test(dcpl) < 0) TEST_ERROR
if (H5P_reset_external_file_test(dcpl2) < 0) TEST_ERROR
}
@@ -2311,7 +2310,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
#endif /* H5_CLEAR_MEMORY */
for(i = 0; i < DIM_SIZE_1; i++) {
buf[i].a = i;
- buf[i].d = 1.0F / (i + 1);
+ buf[i].d = (double)1.0F / (double)(i + 1);
} /* end for */
/* Initialize the filenames */
@@ -2443,9 +2442,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* set initial data values */
for(i = 0; i < DIM_SIZE_1; i++) {
- buf1d[i] = (float)(i / 2.0F);
+ buf1d[i] = (float)i / 2.0F;
for(j = 0; j < DIM_SIZE_2; j++)
- buf2d[i][j] = (float)(i + (j / 100.0F));
+ buf2d[i][j] = (float)i + ((float)j / 100.0F);
} /* end for */
/* Initialize the filenames */
@@ -2695,10 +2694,10 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED2, fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- /* open the dataset for copy */
+ /* open the dataset NAME_DATASET_CHUNKED in SRC file */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
- /* open the destination dataset */
+ /* open the copied dataset NAME_DATASET_CHUNKED at destination */
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check if the datasets are equal */
@@ -2710,10 +2709,10 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the source dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /* open the dataset for copy */
+ /* open the dataset NAME_DATASET_CHUNKED_SINGLE in SRC file */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
- /* open the destination dataset */
+ /* open the copied dataset NAME_DATASET_CHUNKED2 at destination */
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check if the datasets are equal */
@@ -2786,9 +2785,9 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* set initial data values */
for(i = 0; i < DIM_SIZE_1; i++) {
- buf1d[i] = (float)(i / 10.0F);
+ buf1d[i] = (float)i / 10.0F;
for(j = 0; j < DIM_SIZE_2; j++)
- buf2d[i][j] = (float)(i + (j / 100.0F));
+ buf2d[i][j] = (float)i + ((float)j / 100.0F);
} /* end for */
/* Initialize the filenames */
@@ -2836,6 +2835,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+
/* Set 2-D dataspace dimensions */
dim2d[0]=DIM_SIZE_1;
dim2d[1]=DIM_SIZE_2;
@@ -2874,6 +2874,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
@@ -2906,6 +2907,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the source dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+
/* open the dataset for copy */
if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2994,8 +2996,8 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
/* Set dataspace dimensions */
- dim2d[0]=DIM_SIZE_1;
- dim2d[1]=DIM_SIZE_2;
+ dim2d[0] = DIM_SIZE_1;
+ dim2d[1] = DIM_SIZE_2;
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
@@ -3110,7 +3112,7 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* set initial data values */
for (i=0; i<DIM_SIZE_1; i++)
for (j=0; j<DIM_SIZE_2; j++)
- buf[i][j] = (float)(i+j/100.0F);
+ buf[i][j] = (float)i + (float)j / 100.0F;
/* Initialize the filenames */
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
@@ -4208,6 +4210,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
@@ -7245,7 +7248,7 @@ static int
test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
- hid_t tid = -1, tid2=-1; /* Datatype ID */
+ hid_t tid = -1, tid2=-1; /* Datatype ID */
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
@@ -7301,7 +7304,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create nested VL datatype */
if((tid2 = H5Tvlen_create(tid)) < 0) TEST_ERROR
- /* create and set chunk plist */
+ /* create and set chunk plist */
if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
@@ -7317,6 +7320,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
+
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
@@ -7582,12 +7586,12 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* set initial data values */
for(i = 0; i < DIM_SIZE_1; i++) {
- buf[i].a = i * (i - 1);
+ buf[i].a = (int)(i * (i - 1));
buf[i].b.len = i+1;
buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int));
for(j = 0; j < buf[i].b.len; j++)
((int *)buf[i].b.p)[j] = (int)(i * 10 + j);
- buf[i].c = 1.0F / (i + 1.0F);
+ buf[i].c = 1.0F / ((float)i + 1.0F);
} /* end for */
/* Initialize the filenames */
@@ -7721,12 +7725,12 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* set initial data values */
for(i = 0; i < DIM_SIZE_1; i++) {
- buf[i].a = i * (i - 1);
+ buf[i].a = (int)(i * (i - 1));
buf[i].b.len = i+1;
buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int));
for(j = 0; j < buf[i].b.len; j++)
((int *)buf[i].b.p)[j] = (int)(i * 10 + j);
- buf[i].c = 1.0F / (i + 1.0F);
+ buf[i].c = 1.0F / ((float)i + 1.0F);
} /* end for */
/* Initialize the filenames */
@@ -7866,12 +7870,12 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* set initial data values */
for(i = 0; i < DIM_SIZE_1; i++) {
- buf[i].a = i * (i - 1);
+ buf[i].a = (int)(i * (i - 1));
buf[i].b.len = i+1;
buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int));
for(j = 0; j < buf[i].b.len; j++)
((int *)buf[i].b.p)[j] = (int)(i * 10 + j);
- buf[i].c = 1.0F / (i + 1.0F);
+ buf[i].c = 1.0F / ((float)i + 1.0F);
} /* end for */
/* Initialize the filenames */
@@ -12364,7 +12368,7 @@ main(void)
nerrors += test_copy_old_layout(fcpl_dst, dst_fapl);
nerrors += test_copy_null_ref(fcpl_src, fcpl_dst, src_fapl, dst_fapl);
nerrors += test_copy_iterate(fcpl_src, fcpl_dst, src_fapl, dst_fapl);
- }
+ } /* end if */
/* TODO: not implemented
nerrors += test_copy_mount(src_fapl);
diff --git a/test/ohdr.c b/test/ohdr.c
index 53aa18f..87c0b46 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -835,8 +835,8 @@ main(void)
if(H5Fclose(file) < 0)
TEST_ERROR
- /* Test object header creation metadata cache issues */
- if(test_ohdr_cache(filename, fapl) < 0)
+ /* Test object header creation metadata cache issues */
+ if(test_ohdr_cache(filename, fapl) < 0)
TEST_ERROR
} /* end for */
@@ -845,7 +845,7 @@ main(void)
puts("All object header tests passed.");
h5_cleanup(FILENAME, fapl);
- return(0);
+ return 0;
error:
puts("*** TESTS FAILED ***");
@@ -853,6 +853,6 @@ error:
H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* end main() */