diff options
Diffstat (limited to 'test/gheap.c')
-rw-r--r-- | test/gheap.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/test/gheap.c b/test/gheap.c index 4369b1b..28f05a6 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -81,7 +81,7 @@ test_1(hid_t fapl) TESTING("monotonically increasing lengths"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -101,7 +101,7 @@ test_1(hid_t fapl) */ for (u = 0; u < GHEAP_TEST_NOBJS; u++) { size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); status = H5HG_insert(f, size, out, obj + u); if (status < 0) { @@ -121,14 +121,14 @@ test_1(hid_t fapl) */ for (u = 0; u < GHEAP_TEST_NOBJS; u++) { size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); if (NULL == H5HG_read(f, obj + u, in, NULL)) { H5_FAILED(); HDputs(" Unable to read object"); nerrors++; } - else if (HDmemcmp(in, out, size) != 0) { + else if (memcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; @@ -136,7 +136,7 @@ test_1(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -154,7 +154,7 @@ error: } H5E_END_TRY; if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -189,7 +189,7 @@ test_2(hid_t fapl) TESTING("monotonically decreasing lengths"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -207,7 +207,7 @@ test_2(hid_t fapl) */ for (u = 0; u < GHEAP_TEST_NOBJS; u++) { size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); if (H5HG_insert(f, size, out, obj + u) < 0) { H5_FAILED(); @@ -221,14 +221,14 @@ test_2(hid_t fapl) */ for (u = 0; u < GHEAP_TEST_NOBJS; u++) { size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); if (NULL == H5HG_read(f, obj + u, in, NULL)) { H5_FAILED(); HDputs(" Unable to read object"); nerrors++; } - else if (HDmemcmp(in, out, size) != 0) { + else if (memcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; @@ -236,7 +236,7 @@ test_2(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -254,7 +254,7 @@ error: } H5E_END_TRY; if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -289,7 +289,7 @@ test_3(hid_t fapl) TESTING("complete object removal"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -305,7 +305,7 @@ test_3(hid_t fapl) /* Create some stuff */ for (u = 0; u < GHEAP_TEST_NOBJS; u++) { size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); status = H5HG_insert(f, size, out, obj + u); if (status < 0) { @@ -326,7 +326,7 @@ test_3(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -344,7 +344,7 @@ error: } H5E_END_TRY; if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -380,7 +380,7 @@ test_4(hid_t fapl) TESTING("partial object removal"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -396,7 +396,7 @@ test_4(hid_t fapl) for (u = 0; u < GHEAP_TEST_NOBJS; u++) { /* Insert */ size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); + memset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); status = H5HG_insert(f, size, out, obj + u); if (status < 0) { @@ -417,12 +417,12 @@ test_4(hid_t fapl) HDputs(" Unable to remove object"); nerrors++; } - HDmemset(obj + u - 1, 0, sizeof *obj); + memset(obj + u - 1, 0, sizeof *obj); } } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -440,7 +440,7 @@ error: } H5E_END_TRY; if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -474,7 +474,7 @@ test_ooo_indices(hid_t fapl) TESTING("out of order indices"); - if (NULL == (obj = (H5HG_t *)HDmalloc(2000 * sizeof(*obj)))) + if (NULL == (obj = (H5HG_t *)malloc(2000 * sizeof(*obj)))) goto error; /* Open a clean file */ @@ -517,8 +517,8 @@ test_ooo_indices(hid_t fapl) } /* The indices should have "wrapped around" on the last iteration */ - HDassert(obj[534].idx == 65535); - HDassert(obj[535].idx == 1); + assert(obj[534].idx == 65535); + assert(obj[535].idx == 1); /* Reopen the file */ if (H5Fclose(file) < 0) @@ -546,7 +546,7 @@ test_ooo_indices(hid_t fapl) goto error; if (nerrors) goto error; - HDfree(obj); + free(obj); obj = NULL; PASSED(); @@ -559,7 +559,7 @@ error: } H5E_END_TRY; if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } /* end test_ooo_indices */ @@ -608,7 +608,7 @@ main(void) api_ctx_pushed = FALSE; h5_cleanup(FILENAME, fapl_id); - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); error: H5E_BEGIN_TRY @@ -621,5 +621,5 @@ error: H5CX_pop(FALSE); HDputs("*** TESTS FAILED ***"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end main() */ |