diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-11-15 17:58:00 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-11-15 17:58:00 (GMT) |
commit | 612faec1aceceb595c77da52b092b7683581e776 (patch) | |
tree | 04cd2b08a14294c54b3099febd491dfdd1ae551b /test | |
parent | f5b8c0b3e8cef397e2e7070223c8fdfdcc9fbdf6 (diff) | |
download | hdf5-612faec1aceceb595c77da52b092b7683581e776.zip hdf5-612faec1aceceb595c77da52b092b7683581e776.tar.gz hdf5-612faec1aceceb595c77da52b092b7683581e776.tar.bz2 |
[svn-r24454] Checkin for bug fix SWMR-11: used message file to coordinate test runs for h5watch.
The changes were initially done as part of the file locking implementation.
In addition, fixes for the following:
A) Bug fix when enable-production in test/tfile.c--
--test_swmr_write(): use latest format in creating the test files
B) Bug fixes to sync up with revise_chksum_retry branch:
1) test/accum.c--fix to use new_argv/new_envp for execve() and clean out compilation warnings
2) hl/src/H5HLprivate2.h--put the defines in alphabetical order
3) hl/tools/h5watch/h5watch.c--h5watch test exit code error due to error stack
4) hl/tools/h5watch/extend_dset.c--clean up some compilation warnings
Tested on jam, ostrich, koala, platypus, emu, aix.
Diffstat (limited to 'test')
-rw-r--r-- | test/accum.c | 133 | ||||
-rw-r--r-- | test/tfile.c | 31 |
2 files changed, 90 insertions, 74 deletions
diff --git a/test/accum.c b/test/accum.c index 6c89765..1a218c6 100644 --- a/test/accum.c +++ b/test/accum.c @@ -168,7 +168,7 @@ test_write_read(void) /* 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 */ @@ -179,7 +179,7 @@ test_write_read(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -224,7 +224,7 @@ test_write_read_nonacc_front(void) /* 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 */ @@ -238,7 +238,7 @@ test_write_read_nonacc_front(void) if(accum_reset() < 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() < 0) FAIL_STACK_ERROR; @@ -283,7 +283,7 @@ test_write_read_nonacc_end(void) /* 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 */ @@ -297,7 +297,7 @@ test_write_read_nonacc_end(void) if(accum_reset() < 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() < 0) FAIL_STACK_ERROR; @@ -529,7 +529,7 @@ test_accum_overlap(void) /* 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 */ @@ -701,7 +701,7 @@ test_accum_overlap_clean(void) /* 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 */ @@ -880,7 +880,7 @@ test_accum_non_overlap_size(void) /* 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 */ @@ -947,7 +947,7 @@ test_accum_overlap_size(void) /* 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 */ @@ -1054,11 +1054,11 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1084,10 +1084,10 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1122,7 +1122,7 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1162,7 +1162,7 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1199,7 +1199,7 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1231,7 +1231,7 @@ test_accum_adjust(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1314,7 +1314,7 @@ test_read_after(void) /* 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() < 0) FAIL_STACK_ERROR; @@ -1356,13 +1356,13 @@ test_big(void) 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 */ @@ -1380,12 +1380,12 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1397,14 +1397,14 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1416,13 +1416,13 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1434,13 +1434,13 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1457,12 +1457,12 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1479,13 +1479,13 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1506,14 +1506,14 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1535,13 +1535,13 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1562,13 +1562,13 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1589,14 +1589,14 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1617,8 +1617,8 @@ test_big(void) 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() < 0) FAIL_STACK_ERROR; @@ -1670,9 +1670,9 @@ test_random_write(void) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)malloc(RANDOM_BUF_SIZE); + wbuf = (uint8_t *)malloc((size_t)RANDOM_BUF_SIZE); HDassert(wbuf); - rbuf = (uint8_t *)calloc(RANDOM_BUF_SIZE, 1); + rbuf = (uint8_t *)calloc((size_t)RANDOM_BUF_SIZE, (size_t)1); HDassert(rbuf); /* Initialize write buffer */ @@ -1756,7 +1756,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() < 0) FAIL_STACK_ERROR; @@ -1810,6 +1810,8 @@ test_swmr_write_big(void) unsigned u; /* Local index variable */ pid_t pid; /* Process ID */ int status; /* Status returned from child process */ + char *new_argv[] = {NULL}; + char *new_envp[] = {NULL}; TESTING("SWMR write of large metadata"); @@ -1845,9 +1847,9 @@ test_swmr_write_big(void) FAIL_STACK_ERROR; /* Allocate space for the write & read buffers */ - if((wbuf2 = (uint8_t *)HDmalloc(BIG_BUF_SIZE)) == NULL) + if((wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; - if((rbuf = (uint8_t *)HDmalloc(BIG_BUF_SIZE)) == NULL) + if((rbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; /* Initialize wbuf with "0, 1, 2...1024"*/ @@ -1861,7 +1863,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Flush the data to disk */ if(H5F_accum_reset(rf, H5P_DATASET_XFER_DEFAULT, TRUE) < 0) FAIL_STACK_ERROR; @@ -1881,7 +1883,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* The data stays in the accumulator */ /* Write a large piece of metadata [2048, BIG_BUF_SIZE] with wbuf2 */ @@ -1891,7 +1893,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Fork child process to verify that the data at [1024, 2014] does get written to disk */ if((pid = HDfork()) < 0) { @@ -1899,7 +1901,8 @@ test_swmr_write_big(void) FAIL_STACK_ERROR; } else if(0 == pid) { /* Child process */ /* Run the reader */ - status = HDexecve(SWMR_READER, NULL, NULL); + status = HDexecve(SWMR_READER, new_argv, new_envp); + printf("errno from execve = %s\n", strerror(errno)); FAIL_STACK_ERROR; } diff --git a/test/tfile.c b/test/tfile.c index 26a94cb..7ea50c6 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3475,15 +3475,23 @@ static void test_swmr_write(void) { hid_t fid, fid2; /* File IDs */ + hid_t fapl; /* File access property list id */ unsigned intent; /* File access flags */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing H5F_ACC_SWMR_WRITE access flag\n")); + /* Create a copy of the file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Set to use the latest library format */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); /* Create file, without SWMR_WRITE flag */ - fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); /* Get the intent & check that the SWMR_WRITE flag is not set */ @@ -3493,7 +3501,7 @@ test_swmr_write(void) /* Try to reopen file w/SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); @@ -3503,7 +3511,7 @@ test_swmr_write(void) /* Create file, with SWMR_WRITE flag */ - fid = H5Fcreate(FILE1, (H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE), H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE1, (H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE), H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3513,12 +3521,12 @@ test_swmr_write(void) /* Try to reopen file w/o SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3537,13 +3545,13 @@ test_swmr_write(void) /* Try to reopen file read-only w/SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid = H5Fopen(FILE1, (H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid = H5Fopen(FILE1, (H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE), fapl); } H5E_END_TRY; VERIFY(fid, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3553,12 +3561,12 @@ test_swmr_write(void) /* Try to reopen file w/o SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3573,6 +3581,11 @@ test_swmr_write(void) /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); + + /* Close the property list */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + } /* end test_swmr_write() */ /**************************************************************** |