summaryrefslogtreecommitdiffstats
path: root/test/timer.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-27 20:43:30 (GMT)
committerGitHub <noreply@github.com>2023-07-27 20:43:30 (GMT)
commit1e91d96fa02466ffe451319bdac1005f84dc7993 (patch)
tree4de04ef502c313dfd766497b20235188761146c0 /test/timer.c
parent95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff)
downloadhdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'test/timer.c')
-rw-r--r--test/timer.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/test/timer.c b/test/timer.c
index 9254596..7231534 100644
--- a/test/timer.c
+++ b/test/timer.c
@@ -43,62 +43,62 @@ test_time_formatting(void)
s = H5_timer_get_time_string(-1.0);
if (NULL == s || HDstrcmp(s, "N/A") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* 0 0 */
s = H5_timer_get_time_string(0.0);
if (NULL == s || HDstrcmp(s, "0.0 s") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 us nanoseconds */
s = H5_timer_get_time_string(123.0E-9);
if (NULL == s || HDstrcmp(s, "123 ns") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 ms microseconds */
s = H5_timer_get_time_string(23.456E-6);
if (NULL == s || HDstrcmp(s, "23.5 us") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 s milliseconds */
s = H5_timer_get_time_string(4.56789E-3);
if (NULL == s || HDstrcmp(s, "4.6 ms") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 min seconds */
s = H5_timer_get_time_string(3.14);
if (NULL == s || HDstrcmp(s, "3.14 s") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 hr mins, secs */
s = H5_timer_get_time_string(2521.0);
if (NULL == s || HDstrcmp(s, "42 m 1 s") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* < 1 d hrs, mins, secs */
s = H5_timer_get_time_string(9756.0);
if (NULL == s || HDstrcmp(s, "2 h 42 m 36 s") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
/* > 1 d days, hrs, mins, secs */
s = H5_timer_get_time_string(280802.0);
if (NULL == s || HDstrcmp(s, "3 d 6 h 0 m 2 s") != 0)
TEST_ERROR;
- HDfree(s);
+ free(s);
PASSED();
return 0;
error:
if (s)
- HDfree(s);
+ free(s);
return -1;
}
@@ -143,14 +143,14 @@ test_timer_system_user(void)
*/
if (timer.initial.system < 0.0 || timer.initial.user < 0.0) {
SKIPPED();
- HDprintf("NOTE: No suitable way to get system/user times on this platform.\n");
+ printf("NOTE: No suitable way to get system/user times on this platform.\n");
return 0;
}
/* Do some fake work */
for (i = 0; i < 1024; i++) {
- buf = (char *)HDmalloc(1024 * (size_t)i);
- HDfree(buf);
+ buf = (char *)malloc(1024 * (size_t)i);
+ free(buf);
}
err = H5_timer_stop(&timer);
@@ -208,8 +208,8 @@ test_timer_elapsed(void)
/* Do some fake work */
for (i = 0; i < 1024; i++) {
- buf = (char *)HDmalloc(1024 * (size_t)i);
- HDfree(buf);
+ buf = (char *)malloc(1024 * (size_t)i);
+ free(buf);
}
err = H5_timer_stop(&timer);
@@ -275,8 +275,8 @@ test_timer_functionality(void)
/* Do some fake work */
for (i = 0; i < 1024; i++) {
- buf = (char *)HDmalloc(1024 * (size_t)i);
- HDfree(buf);
+ buf = (char *)malloc(1024 * (size_t)i);
+ free(buf);
}
/* Running state should change after stop */
@@ -317,8 +317,8 @@ test_timer_functionality(void)
/* Do some fake work */
for (i = 0; i < 1024; i++) {
- buf = (char *)HDmalloc(1024 * (size_t)i);
- HDfree(buf);
+ buf = (char *)malloc(1024 * (size_t)i);
+ free(buf);
}
/* Times should be non-negative */
@@ -334,8 +334,8 @@ test_timer_functionality(void)
/* Do some fake work */
for (i = 0; i < 1024; i++) {
- buf = (char *)HDmalloc(1024 * (size_t)i);
- HDfree(buf);
+ buf = (char *)malloc(1024 * (size_t)i);
+ free(buf);
}
/* State should flip on stop */
@@ -380,7 +380,7 @@ main(void)
h5_reset();
- HDprintf("Testing platform-independent timer functionality.\n");
+ printf("Testing platform-independent timer functionality.\n");
nerrors += test_time_formatting() < 0 ? 1 : 0;
nerrors += test_timer_system_user() < 0 ? 1 : 0;
@@ -388,12 +388,11 @@ main(void)
nerrors += test_timer_functionality() < 0 ? 1 : 0;
if (nerrors) {
- HDprintf("***** %d platform-independent timer TEST%s FAILED! *****\n", nerrors,
- nerrors > 1 ? "S" : "");
+ printf("***** %d platform-independent timer TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
return 1;
}
else {
- HDprintf("All platform-independent timer tests passed.\n");
+ printf("All platform-independent timer tests passed.\n");
return 0;
}
}