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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
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
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
3 /* #include <assert.h> */
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
4
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
5 __code rbTreeTest1(struct Tree* tree) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
6 printf("Test1\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
7 Node* node = new Node();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
8 node->value = 3;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
9 node->key = 3;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
10 printf("value->%d,key->%d\n",node->value,node->key);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
11 goto tree->put(node, rbTreeTest2);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
12 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
13
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
14 __code rbTreeTest1_stub(struct Context* context) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
15 printf("test1_stub\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
16 Tree* tree = createRedBlackTree(context);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
17 goto rbTreeTest1(context,tree);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
18 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
19
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
20
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
21 __code rbTreeTest2(struct Tree* tree) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
22 printf("Test2\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
23 Node* node = new Node();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
24 node->value = 4;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
25 node->key = 4;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
26 goto tree->put(node, rbTreeTest3);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
27 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
28
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
29 __code rbTreeTest2_stub(struct Context* context) {
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
30 printf("test2_stub\n");
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
31 Tree* tree = (struct Tree*)Gearef(context, Tree)->tree;
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
32 goto rbTreeTest2(context,tree);
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
33 }
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
34
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
35
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
36 __code rbTreeTest3(struct Tree* tree) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
37 printf("test3\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
38 Node* node = new Node();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
39 node->value = 2;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
40 node->key = 2;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
41 goto tree->put(node, rbTreeTest4);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
42 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
43
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
44
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
45 __code rbTreeTest4(struct Tree* tree) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
46 printf("test4\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
47 Node* node = new Node();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
48 node->value = 8;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
49 node->key = 8;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
50 goto tree->put(node, rbTreeTest5);
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
51 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
52
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
53
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
54 __code rbTreeTest5(struct Tree* tree) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
55 printf("test5\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
56 Node* node = new Node();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
57 node->value = 7;
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
58 node->key = 7;
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
59 goto exit_code(context);
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
60 }
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
61
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
62
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
63
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
64
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
65 int main(int argc, char const* argv[]) {
454
77de0283ac92 Debug RedBlackTree.cbc.
ryokka
parents: 453
diff changeset
66 printf("test_main\n");
453
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
67 goto rbTreeTest1();
40ea6277b91c add rbTree_test.cbc
ryokka
parents:
diff changeset
68 }