-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.cpp
83 lines (76 loc) · 1.69 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* main.c
*
* Created on: 2015. 5. 10.
* Author: innocentevil
*/
#include <stdio.h>
#include <stdlib.h>
#include "autogen.h"
#if TARGET_VAL == 0
#else
#include "cdsl_heap_test.h"
#include "cdsl_list_test.h"
#include "cdsl_slist_test.h"
#include "cdsl_bstree_test.h"
#include "cdsl_spltree_test.h"
#include "cdsl_hashtree_test.h"
#include "cdsl_avltree_test.h"
#include "rbtree_benchmark.h"
#include "avltree_benchmark.h"
#include "cdsl_rbtree_test.h"
#endif
const char *RESULT_STRING[] = {
"FAIL",
"PASS"};
int main(void)
{
#if TARGET_VAL == 0
#else
setbuf(stdout, NULL);
BOOL result;
printf("Heap Test Result : %s\n", RESULT_STRING[result = cdsl_heapDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Binary Search Tree Test Result : %s\n", RESULT_STRING[result = cdsl_bstreeDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Splay tree Test Result : %s\n", RESULT_STRING[result = cdsl_spltreeDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Singly-Linked List Test Result : %s\n", RESULT_STRING[result = cdsl_slistDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Doubly-Linked List Test Result : %s\n", RESULT_STRING[result = cdsl_listDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Red Black Tree Test Result : %s\n", RESULT_STRING[result = cdsl_rbtreeDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("Hash Tree Test Result : %s\n", RESULT_STRING[result = cdsl_hashtreeDoTest()]);
if (result == FALSE)
{
exit(-1);
}
printf("AVL Tree Test Result : %s\n", RESULT_STRING[result = cdsl_avltreeDoTest()]);
if (result == FALSE)
{
exit(-1);
}
perform_avltree_benchmark();
perform_rbtree_benchmark();
#endif
return 0;
}