summaryrefslogtreecommitdiffstats
path: root/test/accum.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/accum.c')
-rw-r--r--test/accum.c494
1 files changed, 247 insertions, 247 deletions
diff --git a/test/accum.c b/test/accum.c
index 816d9c0..aaa65d4 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -192,10 +192,10 @@ test_write_read(H5F_t *f)
TESTING("simple write/read to/from metadata accumulator");
/* Allocate buffers */
- write_buf = (int *)HDmalloc(1024 * sizeof(int));
- HDassert(write_buf);
- read_buf = (int *)HDcalloc((size_t)1024, sizeof(int));
- HDassert(read_buf);
+ write_buf = (int *)malloc(1024 * sizeof(int));
+ assert(write_buf);
+ read_buf = (int *)calloc((size_t)1024, sizeof(int));
+ assert(read_buf);
/* Fill buffer with data, zero out read buffer */
for (i = 0; i < 1024; i++)
@@ -207,7 +207,7 @@ test_write_read(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(0, 1024, read_buf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(write_buf, read_buf, (size_t)1024) != 0)
+ if (memcmp(write_buf, read_buf, (size_t)1024) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -216,15 +216,15 @@ test_write_read(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 0;
error:
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 1;
} /* test_write_read */
@@ -251,10 +251,10 @@ test_write_read_nonacc_front(H5F_t *f)
TESTING("simple write/read to/from before metadata accumulator");
/* Allocate buffers */
- write_buf = (int *)HDmalloc(2048 * sizeof(int));
- HDassert(write_buf);
- read_buf = (int *)HDcalloc((size_t)2048, sizeof(int));
- HDassert(read_buf);
+ write_buf = (int *)malloc(2048 * sizeof(int));
+ assert(write_buf);
+ read_buf = (int *)calloc((size_t)2048, sizeof(int));
+ assert(read_buf);
/* Fill buffer with data, zero out read buffer */
for (i = 0; i < 2048; i++)
@@ -272,7 +272,7 @@ test_write_read_nonacc_front(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(0, 1024, read_buf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(write_buf, read_buf, (size_t)1024) != 0)
+ if (memcmp(write_buf, read_buf, (size_t)1024) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -281,15 +281,15 @@ test_write_read_nonacc_front(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 0;
error:
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 1;
} /* test_write_read */
@@ -316,10 +316,10 @@ test_write_read_nonacc_end(H5F_t *f)
TESTING("simple write/read to/from after metadata accumulator");
/* Allocate buffers */
- write_buf = (int *)HDmalloc(2048 * sizeof(int));
- HDassert(write_buf);
- read_buf = (int *)HDcalloc((size_t)2048, sizeof(int));
- HDassert(read_buf);
+ write_buf = (int *)malloc(2048 * sizeof(int));
+ assert(write_buf);
+ read_buf = (int *)calloc((size_t)2048, sizeof(int));
+ assert(read_buf);
/* Fill buffer with data, zero out read buffer */
for (i = 0; i < 2048; i++)
@@ -337,7 +337,7 @@ test_write_read_nonacc_end(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(1024, 1024, read_buf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(write_buf, read_buf, (size_t)1024) != 0)
+ if (memcmp(write_buf, read_buf, (size_t)1024) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -346,15 +346,15 @@ test_write_read_nonacc_end(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 0;
error:
/* Release memory */
- HDfree(write_buf);
- HDfree(read_buf);
+ free(write_buf);
+ free(read_buf);
return 1;
} /* test_write_read */
@@ -383,12 +383,12 @@ test_free(H5F_t *f)
TESTING("simple freeing metadata accumulator");
/* Write and free the whole accumulator. */
- wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t));
- HDassert(rbuf);
- expect = (int32_t *)HDmalloc(256 * sizeof(int32_t));
- HDassert(expect);
+ wbuf = (int32_t *)malloc(256 * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)malloc(256 * sizeof(int32_t));
+ assert(rbuf);
+ expect = (int32_t *)malloc(256 * sizeof(int32_t));
+ assert(expect);
/* Fill buffer with data */
for (i = 0; i < 256; i++)
@@ -424,7 +424,7 @@ test_free(H5F_t *f)
/* Check that the accumulator still contains the correct data */
if (accum_read(1 * sizeof(int32_t), 127 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Free the block of 4B at 127*4B */
@@ -434,7 +434,7 @@ test_free(H5F_t *f)
/* Check that the accumulator still contains the correct data */
if (accum_read(1 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Free the block of 4B at 2*4B */
@@ -444,132 +444,132 @@ test_free(H5F_t *f)
/* Check that the accumulator still contains the correct data */
if (accum_read(1 * sizeof(int32_t), 1 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf + 1, rbuf, 1 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf + 1, rbuf, 1 * sizeof(int32_t)) != 0)
TEST_ERROR;
if (accum_read(3 * sizeof(int32_t), 124 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf + 3, rbuf, 124 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf + 3, rbuf, 124 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section that overlaps the start of the accumulator and is
* entirely before dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
+ memcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
if (accum_free(f, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(66 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 66, rbuf, 126 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 66, rbuf, 126 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section that overlaps the start of the accumulator and
* completely contains dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
+ memcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
if (accum_free(f, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 78, rbuf, 114 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 78, rbuf, 114 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section completely contained in accumulator and is entirely
* before dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
+ memcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
if (accum_free(f, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(70 * sizeof(int32_t), 122 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 70, rbuf, 122 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 70, rbuf, 122 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section completely contained in accumulator, starts before
* dirty section, and ends in dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
+ memcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
if (accum_free(f, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(74 * sizeof(int32_t), 118 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 74, rbuf, 118 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 74, rbuf, 118 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section completely contained in accumulator and completely
* contains dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
+ memcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
if (accum_free(f, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 78, rbuf, 114 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 78, rbuf, 114 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Test freeing section completely contained in accumulator, starts at start
* of dirty section, and ends in dirty section */
if (accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
+ memcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
if (accum_flush(f) < 0)
FAIL_STACK_ERROR;
if (accum_write(72 * sizeof(int32_t), 8 * sizeof(int32_t), wbuf) < 0)
FAIL_STACK_ERROR;
- HDmemcpy(expect + 72, wbuf, 8 * sizeof(int32_t));
+ memcpy(expect + 72, wbuf, 8 * sizeof(int32_t));
if (accum_free(f, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0)
FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if (accum_read(76 * sizeof(int32_t), 116 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(expect + 76, rbuf, 116 * sizeof(int32_t)) != 0)
+ if (memcmp(expect + 76, rbuf, 116 * sizeof(int32_t)) != 0)
TEST_ERROR;
- HDfree(wbuf);
+ free(wbuf);
wbuf = NULL;
- HDfree(rbuf);
+ free(rbuf);
rbuf = NULL;
- HDfree(expect);
+ free(expect);
expect = NULL;
if (accum_reset(f) < 0)
@@ -581,11 +581,11 @@ test_free(H5F_t *f)
error:
if (wbuf)
- HDfree(wbuf);
+ free(wbuf);
if (rbuf)
- HDfree(rbuf);
+ free(rbuf);
if (expect)
- HDfree(expect);
+ free(expect);
return 1;
} /* test_free */
@@ -614,10 +614,10 @@ test_accum_overlap(H5F_t *f)
TESTING("overlapping write to metadata accumulator");
/* Allocate buffers */
- wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int32_t *)malloc(4096 * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t));
+ assert(rbuf);
/* Case 1: No metadata in accumulator */
/* Write 10 1's at address 40 */
@@ -629,7 +629,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(40, 10 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 2: End of new piece aligns with start of accumulated data */
@@ -641,7 +641,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(20, 5 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 3: Start of new piece aligns with start of accumulated data */
@@ -653,7 +653,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(20, 3 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 4: New piece overlaps start of accumulated data */
@@ -665,7 +665,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(8, 5 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 5: New piece completely within accumulated data */
@@ -677,7 +677,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(48, 4 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 6: End of new piece aligns with end of accumulated data */
@@ -689,7 +689,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(68, 3 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 7: New piece overlaps end of accumulated data */
@@ -701,7 +701,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(76, 5 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 8: Start of new piece aligns with end of accumulated data */
@@ -713,7 +713,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(96, 3 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Set up expected data buffer and verify contents of
@@ -738,7 +738,7 @@ test_accum_overlap(H5F_t *f)
wbuf[i] = 8;
if (accum_read(8, 25 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 25 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 25 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 9: New piece completely before accumulated data */
@@ -750,7 +750,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(0, 1 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 1 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 1 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 10: New piece completely after accumulated data */
@@ -762,7 +762,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(116, 4 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 11: New piece completely overlaps accumulated data */
@@ -774,7 +774,7 @@ test_accum_overlap(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(112, 6 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -783,15 +783,15 @@ test_accum_overlap(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* test_accum_overlap */
@@ -821,10 +821,10 @@ test_accum_overlap_clean(H5F_t *f)
TESTING("overlapping write to partially clean metadata accumulator");
/* Allocate buffers */
- wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int32_t *)malloc(4096 * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t));
+ assert(rbuf);
/* Case 1: No metadata in accumulator */
/* Write 10 1's at address 40 */
@@ -836,7 +836,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(40, 10 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 2: End of new piece aligns with start of clean accumulated data */
@@ -850,7 +850,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(20, 5 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 5 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 3: Start of new piece aligns with start of accumulated data,
@@ -863,7 +863,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(20, 6 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 4: New piece completely within accumulated data, overlaps
@@ -876,7 +876,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(40, 2 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 5: New piece completely within accumulated data, completely
@@ -889,7 +889,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(52, 2 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 6: New piece completely within clean accumulated data */
@@ -903,7 +903,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(44, 3 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 7: New piece overlaps start of clean accumulated data */
@@ -917,7 +917,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(16, 2 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 8: New piece overlaps start of accumulated data, completely
@@ -930,7 +930,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(12, 4 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 9: Start of new piece aligns with end of clean accumulated data */
@@ -944,7 +944,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(80, 3 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 10: New piece overlaps end of clean accumulated data */
@@ -958,7 +958,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(88, 2 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 2 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 11: New piece overlaps end of accumulated data, completely encloses
@@ -971,7 +971,7 @@ test_accum_overlap_clean(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(84, 4 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 4 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Set up expected data buffer and verify contents of
@@ -994,7 +994,7 @@ test_accum_overlap_clean(H5F_t *f)
wbuf[i] = 7;
if (accum_read(12, 22 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1003,15 +1003,15 @@ test_accum_overlap_clean(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* test_accum_overlap_clean */
@@ -1040,10 +1040,10 @@ test_accum_non_overlap_size(H5F_t *f)
TESTING("non-overlapping write to accumulator larger then accum_size");
/* Allocate buffers */
- wbuf = (int *)HDmalloc(4096 * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int *)HDcalloc((size_t)4096, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int *)malloc(4096 * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int *)calloc((size_t)4096, sizeof(int32_t));
+ assert(rbuf);
/* Case 1: No metadata in accumulator */
/* Write 10 1's at address 140 */
@@ -1055,7 +1055,7 @@ test_accum_non_overlap_size(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(140, 10 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 9: New piece completely before accumulated data */
@@ -1067,7 +1067,7 @@ test_accum_non_overlap_size(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(0, 20 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1076,15 +1076,15 @@ test_accum_non_overlap_size(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* test_accum_non_overlap_size */
@@ -1114,10 +1114,10 @@ test_accum_overlap_size(H5F_t *f)
TESTING("overlapping write to accumulator larger then accum_size");
/* Allocate buffers */
- wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int32_t *)malloc(4096 * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t));
+ assert(rbuf);
/* Case 1: No metadata in accumulator */
/* Write 10 1's at address 64 */
@@ -1129,7 +1129,7 @@ test_accum_overlap_size(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(64, 10 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 10 * sizeof(int32_t)) != 0)
TEST_ERROR;
/* Case 9: New piece completely before accumulated data */
@@ -1141,7 +1141,7 @@ test_accum_overlap_size(H5F_t *f)
FAIL_STACK_ERROR;
if (accum_read(60, 72 * sizeof(int32_t), rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0)
+ if (memcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1150,15 +1150,15 @@ test_accum_overlap_size(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* test_accum_overlap_size */
@@ -1199,10 +1199,10 @@ test_accum_adjust(H5F_t *f)
TESTING("accumulator adjustments after append/prepend of data");
/* Allocate buffers */
- wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int32_t *)malloc((size_t)s * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)calloc((size_t)s, sizeof(int32_t));
+ assert(rbuf);
/* Fill up write buffer */
for (i = 0; i < s; i++)
@@ -1232,13 +1232,13 @@ test_accum_adjust(H5F_t *f)
/* Read back and verify first write */
if (accum_read((1024 * 1024), (1024 * 1024) - 1, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)((1024 * 1024) - 1)) != 0)
+ if (memcmp(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, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
/* Reset accumulator for next case */
@@ -1269,12 +1269,12 @@ test_accum_adjust(H5F_t *f)
/* Read back and verify both pieces of data */
if (accum_read(1048576, 1048575, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)1048576) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1048576) != 0)
TEST_ERROR;
if (accum_read(5, 1048571, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1048571) != 0)
TEST_ERROR;
/* Reset accumulator for next case */
@@ -1316,7 +1316,7 @@ test_accum_adjust(H5F_t *f)
the data is as expected */
if (accum_read((1024 * 1024) - 1, 1024, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
/* Reset accumulator for next case */
@@ -1364,7 +1364,7 @@ test_accum_adjust(H5F_t *f)
the data is as expected */
if (accum_read(1048571, 349523, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)349523) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)349523) != 0)
TEST_ERROR;
/* Reset accumulator for next case */
@@ -1409,7 +1409,7 @@ test_accum_adjust(H5F_t *f)
the data is as expected */
if (accum_read((1024 * 1024) - 5, 10, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)10) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)10) != 0)
TEST_ERROR;
/* Reset accumulator for next case */
@@ -1447,7 +1447,7 @@ test_accum_adjust(H5F_t *f)
the data is as expected */
if (accum_read(1048571, 349523, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)349523) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)349523) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1456,15 +1456,15 @@ test_accum_adjust(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* test_accum_adjust */
@@ -1497,10 +1497,10 @@ test_read_after(H5F_t *f)
TESTING("reading data from both accumulator and disk");
/* Allocate buffers */
- wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t));
- HDassert(wbuf);
- rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t));
- HDassert(rbuf);
+ wbuf = (int32_t *)malloc((size_t)s * sizeof(int32_t));
+ assert(wbuf);
+ rbuf = (int32_t *)calloc((size_t)s, sizeof(int32_t));
+ assert(rbuf);
/* Fill up write buffer with 1s */
for (i = 0; i < s; i++)
@@ -1536,7 +1536,7 @@ test_read_after(H5F_t *f)
the data is as expected */
if (accum_read(512, 512, rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf, rbuf, (size_t)128) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)128) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1545,15 +1545,15 @@ test_read_after(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
+ free(wbuf);
+ free(rbuf);
return 1;
} /* end test_read_after */
@@ -1579,14 +1579,14 @@ test_big(H5F_t *f)
unsigned u; /* Local index variable */
/* Allocate space for the write & read buffers */
- wbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE);
- HDassert(wbuf);
- wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE);
- HDassert(wbuf2);
- rbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
- HDassert(rbuf);
- zbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
- HDassert(zbuf);
+ wbuf = (uint8_t *)malloc((size_t)BIG_BUF_SIZE);
+ assert(wbuf);
+ wbuf2 = (uint8_t *)malloc((size_t)BIG_BUF_SIZE);
+ assert(wbuf2);
+ rbuf = (uint8_t *)calloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
+ assert(rbuf);
+ zbuf = (uint8_t *)calloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1);
+ assert(zbuf);
/* Initialize write buffers */
for (u = 0; u < BIG_BUF_SIZE; u++) {
@@ -1605,13 +1605,13 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf, rbuf, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(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, (size_t)BIG_BUF_SIZE);
+ memset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1625,17 +1625,17 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(zbuf, rbuf, (size_t)1024) != 0)
+ if (memcmp(zbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf, rbuf + 1024, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf + 1024, (size_t)1024) != 0)
TEST_ERROR;
- if (HDmemcmp(zbuf, rbuf + 2048, (size_t)(BIG_BUF_SIZE - 2048)) != 0)
+ if (memcmp(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, (size_t)BIG_BUF_SIZE);
+ memset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1649,15 +1649,15 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(zbuf, rbuf, (size_t)(BIG_BUF_SIZE - 512)) != 0)
+ if (memcmp(zbuf, rbuf, (size_t)(BIG_BUF_SIZE - 512)) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf, rbuf + (BIG_BUF_SIZE - 512), (size_t)512) != 0)
+ if (memcmp(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, (size_t)BIG_BUF_SIZE);
+ memset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1671,15 +1671,15 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf + 512, rbuf, (size_t)512) != 0)
+ if (memcmp(wbuf + 512, rbuf, (size_t)512) != 0)
TEST_ERROR;
- if (HDmemcmp(zbuf, rbuf + 512, (size_t)(BIG_BUF_SIZE - 512)) != 0)
+ if (memcmp(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, (size_t)BIG_BUF_SIZE);
+ memset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1699,13 +1699,13 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(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, (size_t)BIG_BUF_SIZE);
+ memset(rbuf, 0, (size_t)BIG_BUF_SIZE);
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1725,15 +1725,15 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf + 512, rbuf + BIG_BUF_SIZE, (size_t)512) != 0)
+ if (memcmp(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, (size_t)(BIG_BUF_SIZE + 512));
+ memset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1758,17 +1758,17 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
- if (HDmemcmp(zbuf, rbuf + BIG_BUF_SIZE, (size_t)512) != 0)
+ if (memcmp(zbuf, rbuf + BIG_BUF_SIZE, (size_t)512) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf, rbuf + BIG_BUF_SIZE + 512, (size_t)512) != 0)
+ if (memcmp(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, (size_t)(BIG_BUF_SIZE + 1024));
+ memset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024));
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1795,15 +1795,15 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(zbuf, rbuf, (size_t)1536) != 0)
+ if (memcmp(zbuf, rbuf, (size_t)1536) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(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, (size_t)(BIG_BUF_SIZE + 1536));
+ memset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1828,15 +1828,15 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(zbuf, rbuf, (size_t)512) != 0)
+ if (memcmp(zbuf, rbuf, (size_t)512) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(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, (size_t)(BIG_BUF_SIZE + 512));
+ memset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1861,17 +1861,17 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
- if (HDmemcmp(zbuf, rbuf + 1024, (size_t)512) != 0)
+ if (memcmp(zbuf, rbuf + 1024, (size_t)512) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(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, (size_t)(BIG_BUF_SIZE + 1536));
+ memset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
if (accum_reset(f) < 0)
FAIL_STACK_ERROR;
@@ -1896,9 +1896,9 @@ test_big(H5F_t *f)
FAIL_STACK_ERROR;
/* Verify data read */
- if (HDmemcmp(wbuf, rbuf, (size_t)512) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)512) != 0)
TEST_ERROR;
- if (HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -1907,18 +1907,18 @@ test_big(H5F_t *f)
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(wbuf2);
- HDfree(rbuf);
- HDfree(zbuf);
+ free(wbuf);
+ free(wbuf2);
+ free(rbuf);
+ free(zbuf);
return 0;
error:
- HDfree(wbuf);
- HDfree(wbuf2);
- HDfree(rbuf);
- HDfree(zbuf);
+ free(wbuf);
+ free(wbuf2);
+ free(rbuf);
+ free(zbuf);
return 1;
} /* end test_big() */
@@ -1950,10 +1950,10 @@ test_random_write(H5F_t *f)
unsigned u; /* Local index variable */
/* Allocate space for the write & read buffers */
- wbuf = (uint8_t *)HDmalloc((size_t)RANDOM_BUF_SIZE);
- HDassert(wbuf);
- rbuf = (uint8_t *)HDcalloc((size_t)RANDOM_BUF_SIZE, (size_t)1);
- HDassert(rbuf);
+ wbuf = (uint8_t *)malloc((size_t)RANDOM_BUF_SIZE);
+ assert(wbuf);
+ rbuf = (uint8_t *)calloc((size_t)RANDOM_BUF_SIZE, (size_t)1);
+ assert(rbuf);
/* Initialize write buffer */
for (u = 0; u < RANDOM_BUF_SIZE; u++)
@@ -1965,15 +1965,15 @@ test_random_write(H5F_t *f)
seed = (unsigned)HDtime(NULL);
#if 0
/* seed = (unsigned)1155438845; */
-HDfprintf(stderr, "Random # seed was: %u\n", seed);
+fprintf(stderr, "Random # seed was: %u\n", seed);
#endif
HDsrandom(seed);
/* Allocate space for the segment length buffer */
- off = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
- HDassert(off);
- len = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
- HDassert(len);
+ off = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
+ assert(off);
+ len = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
+ assert(len);
/* Randomly choose lengths of segments */
cur_off = 0;
@@ -2035,7 +2035,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
/* Verify individual reads */
if (accum_read(RANDOM_BASE_OFF + off[u], len[u], rbuf) < 0)
FAIL_STACK_ERROR;
- if (HDmemcmp(wbuf + off[u], rbuf, len[u]) != 0)
+ if (memcmp(wbuf + off[u], rbuf, len[u]) != 0)
TEST_ERROR;
} /* end for */
@@ -2044,7 +2044,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
FAIL_STACK_ERROR;
/* Verify data read back in */
- if (HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0)
TEST_ERROR;
if (accum_reset(f) < 0)
@@ -2053,21 +2053,21 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
PASSED();
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(off);
- HDfree(len);
+ free(wbuf);
+ free(rbuf);
+ free(off);
+ free(len);
return 0;
error:
/* Release memory */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(off);
- HDfree(len);
+ free(wbuf);
+ free(rbuf);
+ free(off);
+ free(len);
- HDfprintf(stderr, "Random # seed was: %u\n", seed);
+ fprintf(stderr, "Random # seed was: %u\n", seed);
return 1;
} /* end test_random_write() */
@@ -2176,9 +2176,9 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR;
/* Allocate space for the write & read buffers */
- if ((wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL)
+ if ((wbuf2 = (uint8_t *)malloc((size_t)BIG_BUF_SIZE)) == NULL)
FAIL_STACK_ERROR;
- if ((rbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL)
+ if ((rbuf = (uint8_t *)malloc((size_t)BIG_BUF_SIZE)) == NULL)
FAIL_STACK_ERROR;
/* Initialize wbuf with "0, 1, 2...1024"*/
@@ -2192,7 +2192,7 @@ test_swmr_write_big(hbool_t newest_format)
if (H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
- if (HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
/* Flush the data to disk */
if (accum_reset(rf) < 0)
@@ -2213,7 +2213,7 @@ test_swmr_write_big(hbool_t newest_format)
if (H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
- if (HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
+ if (memcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
/* The data stays in the accumulator */
@@ -2224,7 +2224,7 @@ test_swmr_write_big(hbool_t newest_format)
if (H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
- if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
+ if (memcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
#if defined(H5_HAVE_WIN32_API)
@@ -2238,7 +2238,7 @@ test_swmr_write_big(hbool_t newest_format)
ZeroMemory(&pi, sizeof(pi));
if (0 == CreateProcess(NULL, SWMR_READER, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
- HDprintf("CreateProcess failed (%d).\n", GetLastError());
+ printf("CreateProcess failed (%d).\n", GetLastError());
FAIL_STACK_ERROR;
}
@@ -2272,7 +2272,7 @@ test_swmr_write_big(hbool_t newest_format)
char *const new_argv[] = {swmr_reader, NULL};
/* Run the reader */
status = HDexecv(SWMR_READER, new_argv);
- HDprintf("errno from execv = %s\n", HDstrerror(errno));
+ printf("errno from execv = %s\n", HDstrerror(errno));
FAIL_STACK_ERROR;
} /* end if */
@@ -2309,9 +2309,9 @@ test_swmr_write_big(hbool_t newest_format)
/* Release memory */
if (wbuf2)
- HDfree(wbuf2);
+ free(wbuf2);
if (rbuf)
- HDfree(rbuf);
+ free(rbuf);
PASSED();
return 0;
@@ -2327,9 +2327,9 @@ error:
/* Release memory */
if (wbuf2)
- HDfree(wbuf2);
+ free(wbuf2);
if (rbuf)
- HDfree(rbuf);
+ free(rbuf);
return 1;
@@ -2355,31 +2355,31 @@ accum_printf(const H5F_t *f)
{
H5F_meta_accum_t *accum = &f->shared->accum;
- HDprintf("\n");
- HDprintf("Current contents of accumulator:\n");
+ printf("\n");
+ printf("Current contents of accumulator:\n");
if (accum->alloc_size == 0) {
- HDprintf("=====================================================\n");
- HDprintf(" No accumulator allocated.\n");
- HDprintf("=====================================================\n");
+ printf("=====================================================\n");
+ printf(" No accumulator allocated.\n");
+ printf("=====================================================\n");
}
else {
- HDprintf("=====================================================\n");
- HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size);
- HDprintf(" accumulated data size == %zu\n", accum->size);
- HDfprintf(stdout, " accumulator dirty? == %s\n", accum->dirty ? "TRUE" : "FALSE");
- HDprintf("=====================================================\n");
- HDfprintf(stdout, " start of accumulated data, loc = %" PRIuHADDR "\n", accum->loc);
+ printf("=====================================================\n");
+ printf(" accumulator allocated size == %zu\n", accum->alloc_size);
+ printf(" accumulated data size == %zu\n", accum->size);
+ fprintf(stdout, " accumulator dirty? == %s\n", accum->dirty ? "TRUE" : "FALSE");
+ printf("=====================================================\n");
+ fprintf(stdout, " start of accumulated data, loc = %" PRIuHADDR "\n", accum->loc);
if (accum->dirty) {
- HDfprintf(stdout, " start of dirty region, loc = %" PRIuHADDR "\n",
- (haddr_t)(accum->loc + accum->dirty_off));
- HDfprintf(stdout, " end of dirty region, loc = %" PRIuHADDR "\n",
- (haddr_t)(accum->loc + accum->dirty_off + accum->dirty_len));
+ fprintf(stdout, " start of dirty region, loc = %" PRIuHADDR "\n",
+ (haddr_t)(accum->loc + accum->dirty_off));
+ fprintf(stdout, " end of dirty region, loc = %" PRIuHADDR "\n",
+ (haddr_t)(accum->loc + accum->dirty_off + accum->dirty_len));
} /* end if */
- HDfprintf(stdout, " end of accumulated data, loc = %" PRIuHADDR "\n",
- (haddr_t)(accum->loc + accum->size));
- HDfprintf(stdout, " end of accumulator allocation, loc = %" PRIuHADDR "\n",
- (haddr_t)(accum->loc + accum->alloc_size));
- HDprintf("=====================================================\n");
+ fprintf(stdout, " end of accumulated data, loc = %" PRIuHADDR "\n",
+ (haddr_t)(accum->loc + accum->size));
+ fprintf(stdout, " end of accumulator allocation, loc = %" PRIuHADDR "\n",
+ (haddr_t)(accum->loc + accum->alloc_size));
+ printf("=====================================================\n");
}
- HDprintf("\n\n");
+ printf("\n\n");
} /* accum_printf() */