Subversion Repositories HelenOS

Rev

Rev 2022 | Rev 2050 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2022 Rev 2027
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
 
-
 
38
static void *data = (void *) 0xdeadbeef;
34
static void *data = (void *) 0xdeadbeef;
39
 
35
 
40
void test_btree1(void)
36
char * test_btree1(void)
41
{
37
{
42
#ifdef CONFIG_BENCH
-
 
43
    uint64_t t0 = get_cycle();
-
 
44
#endif
-
 
45
    btree_t t;
38
    btree_t t;
46
    int i;
39
    int i;
47
 
40
 
48
    btree_create(&t);
41
    btree_create(&t);
49
 
42
 
Line 161... Line 154...
161
    btree_remove(&t, 34, NULL);
154
    btree_remove(&t, 34, NULL);
162
    btree_remove(&t, 35, NULL);
155
    btree_remove(&t, 35, NULL);
163
    btree_remove(&t, 36, NULL);
156
    btree_remove(&t, 36, NULL);
164
 
157
 
165
    btree_print(&t);
158
    btree_print(&t);
166
#ifdef CONFIG_BENCH
159
   
167
    uint64_t dt = get_cycle() - t0;
-
 
168
    printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
-
 
169
#endif
160
    return NULL;
170
}
161
}