Skip to content

Commit 82d4ff3

Browse files
committed
tests: Update to reflect new v_timer API
Forgot to run tests when I tweaked how timers are started, so the tests didn't build. Should automate building/running those, really. Fixes: 03df5ee
1 parent 9097df8 commit 82d4ff3

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

tests/perf/perf_base64.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ time_t base64_bigfile_encode(void) {
1616
file_data bigfile = file_load("input/venusscaled.obj");
1717
ASSERT(bigfile.items);
1818

19-
v_timer test = { 0 };
20-
v_timer_start(&test);
19+
v_timer test = v_timer_start();
2120

2221
char *encoded = b64encode(bigfile.items, bigfile.count);
2322
(void)encoded;
@@ -35,8 +34,7 @@ time_t base64_bigfile_decode(void) {
3534
char *encoded = b64encode(bigfile.items, bigfile.count);
3635
size_t encodedLength = strlen(encoded);
3736

38-
v_timer test = { 0 };
39-
v_timer_start(&test);
37+
v_timer test = v_timer_start();
4038

4139
char *decoded = b64decode(encoded, encodedLength, NULL);
4240
(void)decoded;

tests/perf/perf_fileio.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include "../../src/common/cr_assert.h"
1313

1414
time_t fileio_load(void) {
15-
v_timer test = { 0 };
16-
v_timer_start(&test);
15+
v_timer test = v_timer_start();
1716

1817
file_data bigfile = file_load("input/venusscaled.obj");
1918
ASSERT(bigfile.items);

tests/testrunner.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ int runTests(char *suite) {
3131
logr(info, "Running tests in a single process. Consider using run-tests.sh instead.\n");
3232

3333
logr(info, "Running %u test%s.\n", test_count, PLURAL(test_count));
34-
v_timer t = { 0 };
35-
v_timer_start(&t);
34+
v_timer t = v_timer_start();
3635
for (unsigned t = 0; t < test_count; ++t) {
3736
runTest(t, suite);
3837
}
@@ -51,8 +50,7 @@ int runPerfTests(char *suite) {
5150

5251
logr(info, "Running %u test%s.\n", test_count, PLURAL(test_count));
5352
logr(info, "Averaging runtime from %i runs for each test.\n", PERF_AVG_COUNT);
54-
v_timer t = { 0 };
55-
v_timer_start(&t);
53+
v_timer t = v_timer_start();
5654
for (unsigned t = 0; t < test_count; ++t) {
5755
runPerfTest(t, suite);
5856
}
@@ -72,8 +70,7 @@ int runTest(unsigned t, char *suite) {
7270
t + 1, test_count,
7371
tests[first_idx + t].test_name);
7472

75-
v_timer test = { 0 };
76-
v_timer_start(&test);
73+
v_timer test = v_timer_start();
7774
bool pass = tests[first_idx + t].func();
7875
time_t usecs = v_timer_get_us(test);
7976

0 commit comments

Comments
 (0)