Mercurial > hg > Members > Moririn
annotate src/parallel_execution/test/rbTree_test.cbc @ 468:ac244346c85d
Change used interface syntax from #include to #interface
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 Dec 2017 18:10:56 +0900 |
parents | 831b7f6fd687 |
children | ed494f4004c9 |
rev | line source |
---|---|
453 | 1 #include "../../context.h" |
468
ac244346c85d
Change used interface syntax from #include to #interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
466
diff
changeset
|
2 #interface "Tree.h" |
454 | 3 /* #include <assert.h> */ |
453 | 4 |
5 __code rbTreeTest1(struct Tree* tree) { | |
454 | 6 printf("Test1\n"); |
453 | 7 Node* node = new Node(); |
8 node->value = 3; | |
9 node->key = 3; | |
10 printf("value->%d,key->%d\n",node->value,node->key); | |
11 goto tree->put(node, rbTreeTest2); | |
12 } | |
13 | |
14 __code rbTreeTest1_stub(struct Context* context) { | |
454 | 15 printf("test1_stub\n"); |
453 | 16 Tree* tree = createRedBlackTree(context); |
17 goto rbTreeTest1(context,tree); | |
18 } | |
19 | |
20 | |
21 __code rbTreeTest2(struct Tree* tree) { | |
454 | 22 printf("Test2\n"); |
453 | 23 Node* node = new Node(); |
24 node->value = 4; | |
25 node->key = 4; | |
26 goto tree->put(node, rbTreeTest3); | |
27 } | |
28 | |
454 | 29 __code rbTreeTest2_stub(struct Context* context) { |
30 printf("test2_stub\n"); | |
31 Tree* tree = (struct Tree*)Gearef(context, Tree)->tree; | |
32 goto rbTreeTest2(context,tree); | |
33 } | |
453 | 34 |
35 | |
36 __code rbTreeTest3(struct Tree* tree) { | |
454 | 37 printf("test3\n"); |
453 | 38 Node* node = new Node(); |
39 node->value = 2; | |
40 node->key = 2; | |
41 goto tree->put(node, rbTreeTest4); | |
42 } | |
43 | |
44 | |
45 __code rbTreeTest4(struct Tree* tree) { | |
454 | 46 printf("test4\n"); |
453 | 47 Node* node = new Node(); |
48 node->value = 8; | |
49 node->key = 8; | |
50 goto tree->put(node, rbTreeTest5); | |
51 } | |
52 | |
53 | |
54 __code rbTreeTest5(struct Tree* tree) { | |
454 | 55 printf("test5\n"); |
453 | 56 Node* node = new Node(); |
57 node->value = 7; | |
58 node->key = 7; | |
454 | 59 goto exit_code(context); |
453 | 60 } |
61 | |
62 | |
454 | 63 |
453 | 64 |
65 int main(int argc, char const* argv[]) { | |
454 | 66 printf("test_main\n"); |
453 | 67 goto rbTreeTest1(); |
68 } |