Rev 1787 | Rev 2022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 2020 | ||
|---|---|---|---|
| Line 29... | Line 29... | ||
| 29 | #include <test.h> |
29 | #include <test.h> |
| 30 | #include <print.h> |
30 | #include <print.h> |
| 31 | #include <adt/btree.h> |
31 | #include <adt/btree.h> |
| 32 | #include <debug.h> |
32 | #include <debug.h> |
| 33 | 33 | ||
| - | 34 | #ifdef CONFIG_BENCH |
|
| - | 35 | #include <arch/cycle.h> |
|
| - | 36 | #endif |
|
| - | 37 | ||
| 34 | void *data = (void *) 0xdeadbeef; |
38 | void *data = (void *) 0xdeadbeef; |
| 35 | 39 | ||
| 36 | void test(void) |
40 | void test_btree1(void) |
| 37 | { |
41 | { |
| - | 42 | #ifdef CONFIG_BENCH |
|
| - | 43 | uint64_t t0 = get_cycle(); |
|
| - | 44 | #endif |
|
| 38 | btree_t t; |
45 | btree_t t; |
| 39 | int i; |
46 | int i; |
| 40 | 47 | ||
| 41 | btree_create(&t); |
48 | btree_create(&t); |
| 42 | 49 | ||
| Line 154... | Line 161... | ||
| 154 | btree_remove(&t, 34, NULL); |
161 | btree_remove(&t, 34, NULL); |
| 155 | btree_remove(&t, 35, NULL); |
162 | btree_remove(&t, 35, NULL); |
| 156 | btree_remove(&t, 36, NULL); |
163 | btree_remove(&t, 36, NULL); |
| 157 | 164 | ||
| 158 | btree_print(&t); |
165 | btree_print(&t); |
| - | 166 | #ifdef CONFIG_BENCH |
|
| - | 167 | uint64_t dt = get_cycle() - t0; |
|
| - | 168 | printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt); |
|
| - | 169 | #endif |
|
| 159 | } |
170 | } |