changeset 208:b6ffdd99e525

fix generate_context
author mir3636
date Tue, 20 Dec 2016 19:39:51 +0900
parents 7470b8382672
children 5708390a9d88
files src/parallel_execution/CMakeLists.txt src/parallel_execution/generate_context.pl src/parallel_execution/test/queue_test.c src/parallel_execution/test/stack_test.c
diffstat 4 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt	Tue Dec 20 17:55:49 2016 +0900
+++ b/src/parallel_execution/CMakeLists.txt	Tue Dec 20 19:39:51 2016 +0900
@@ -37,5 +37,5 @@
   TARGET
       test/queue_test
   SOURCES 
-      main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c test/stack_test.c stack.c test/queue_test.c queue.c
+      TaskManager.c main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c test/stack_test.c stack.c test/queue_test.c queue.c
 )
--- a/src/parallel_execution/generate_context.pl	Tue Dec 20 17:55:49 2016 +0900
+++ b/src/parallel_execution/generate_context.pl	Tue Dec 20 19:39:51 2016 +0900
@@ -47,7 +47,7 @@
     my ($filename) = @_;
     open my $fd,"<",$filename or die("can't open $filename $!");
     while (<$fd>) {
-        if (/__code (\w+)_stub\(struct Context\* context\)/) {
+        if (/^__code (\w+)_stub\(struct Context\* context\)/ or /^\s__code (\w+)_stub\(struct Context\* context\)/) {
             $codeGear{$1} = $filename;
         }
     }
--- a/src/parallel_execution/test/queue_test.c	Tue Dec 20 17:55:49 2016 +0900
+++ b/src/parallel_execution/test/queue_test.c	Tue Dec 20 19:39:51 2016 +0900
@@ -30,6 +30,8 @@
 }
 
 __code queue_test2_stub(struct Context* context) {
+    // assert(((struct Task)context->data[D_Queue]->queue.queue->queue.queue->singleLinkedQueue.top->data)->code == C_QueueTest1)
+    // assert(((struct Task)context->data[D_Queue]->queue.queue->queue.queue->singleLinkedQueue.top->data)->code == C_QueueTest1)
     Task* task = &ALLOCATE(context, Task)->Task;
     goto queue_test2(context,
             task,
@@ -42,6 +44,8 @@
 }
 
 __code queue_test3_stub(struct Context* context) {
+    // assert(((struct Task)context->data[D_Queue]->queue.queue->queue.queue->singleLinkedQueue.top->data)->code == C_QueueTest2)
+    // assert(((struct Task)context->data[D_Queue]->queue.queue->queue.queue->singleLinkedQueue.top->data)->code == C_QueueTest1)
     goto queue_test3(context,
             &context->data[D_Queue]->Queue);
 }
--- a/src/parallel_execution/test/stack_test.c	Tue Dec 20 17:55:49 2016 +0900
+++ b/src/parallel_execution/test/stack_test.c	Tue Dec 20 19:39:51 2016 +0900
@@ -49,7 +49,7 @@
 }
 
 __code stack_test4(struct Context* context) {
-    goto meta(context, C_exit_code);
+    goto meta(context, exit_code);
 }
 
 __code stack_test4_stub(struct Context* context) {