changeset 990:0ee98fba0503

commit to pull
author ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
date Thu, 11 Nov 2021 17:13:39 +0900
parents 65066d677a13
children c64cc1295af0
files src/parallel_execution/RedBlackTree.cbc src/parallel_execution/test/rbTree_test.cbc
diffstat 2 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/RedBlackTree.cbc	Thu Oct 28 14:06:45 2021 +0900
+++ b/src/parallel_execution/RedBlackTree.cbc	Thu Nov 11 17:13:39 2021 +0900
@@ -40,7 +40,7 @@
 __code putRedBlackTree(struct RedBlackTree* tree, struct Node* node) {
     struct Node* newNode = &ALLOCATE(context, Node)->Node;
     struct Node* root = tree->root;
-    //printTree((union Data*)(tree->root));
+    printTree((union Data*)(tree->root));
     tree->newNode = newNode;
     tree->root = newNode; // this should done at stackClear
     tree->parent = NULL;
@@ -290,7 +290,7 @@
     if (tree->root) {
         tree->current = tree->root;
 
-        goto search();
+        goto search(); //inputDGに探すnodeを入れるべき?。
     }
 
     goto next(...);
--- a/src/parallel_execution/test/rbTree_test.cbc	Thu Oct 28 14:06:45 2021 +0900
+++ b/src/parallel_execution/test/rbTree_test.cbc	Thu Nov 11 17:13:39 2021 +0900
@@ -69,9 +69,9 @@
   printf("test5\n");
   Node* node = new Node();
   node->value = (union Data*)new Integer();
-  ((Integer*)node->value)->value = 8;
-  node->key = 8;
-  goto tree->remove(node,exit_code);
+  ((Integer*)node->value)->value = 0;
+  node->key = 7;
+  goto tree->get(rbTreeTest6);
 }
 
 __code rbTreeTest5_stub(struct Context* context) {
@@ -80,6 +80,19 @@
 }
 
 
+__code rbTreeTest6(struct Tree* tree) {
+  printf("test6\n");
+  Node* node = new Node();
+  node->value = (union Data*)new Integer();
+  ((Integer*)node->value)->value = 9;
+  node->key = 9;
+  goto tree->put(node,exit_code);
+}
+
+__code rbTreeTest6_stub(struct Context* context) {
+  Tree* tree = (struct Tree*)Gearef(context, Tree)->tree;
+  goto rbTreeTest6(context,tree);
+}
 
 int main(int argc, char const* argv[]) {
   printf("test_main\n");