diff src/parallel_execution/test/queue_test.cbc @ 350:a9863b41f026

Fix error for queue & stack test
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Wed, 07 Jun 2017 15:17:36 +0900
parents 131a04a70dd8
children c93216e68d70
line wrap: on
line diff
--- a/src/parallel_execution/test/queue_test.cbc	Wed Jun 07 13:46:00 2017 +0900
+++ b/src/parallel_execution/test/queue_test.cbc	Wed Jun 07 15:17:36 2017 +0900
@@ -3,32 +3,32 @@
 
 __code queueTest1(struct Queue* queue) {
     queue->queue = (union Data*)createSingleLinkedQueue(context);
-    Task* task = new Task();
-    task->code = C_queueTest1;
-    queue->data = (union Data*)task;
+    Node* node = new Node();
+    node->color = Red;
+    queue->data = (union Data*)node;
     queue->next = C_assert1;
     goto meta(context, queue->queue->Queue.put);
 }
 
 __code assert1(struct Queue* queue) {
     SingleLinkedQueue* singleLinkedQueue = &queue->queue->Queue.queue->SingleLinkedQueue;
-    assert(singleLinkedQueue->top->data->Task.code == C_queueTest1);
-    assert(singleLinkedQueue->last->data->Task.code == C_queueTest1);
+    assert(singleLinkedQueue->top->data->Node.color == Red);
+    assert(singleLinkedQueue->last->data->Node.color == Red);
     goto meta(context, C_queueTest2);
 }
 
 __code queueTest2(struct Queue* queue) {
-    Task* task = new Task();
-    task->code = C_queueTest2;
-    queue->data = (union Data*)task;
+    Node* node = new Node();
+    node->color = Black;
+    queue->data = (union Data*)node;
     queue->next = C_assert2;
     goto meta(context, queue->queue->Queue.put);
 }
 
 __code assert2(struct Queue* queue) {
     SingleLinkedQueue* singleLinkedQueue = &queue->queue->Queue.queue->SingleLinkedQueue;
-    assert(singleLinkedQueue->top->data->Task.code == C_queueTest1);
-    assert(singleLinkedQueue->last->data->Task.code == C_queueTest2);
+    assert(singleLinkedQueue->top->data->Node.color == Red);
+    assert(singleLinkedQueue->last->data->Node.color == Black);
     goto meta(context, C_queueTest3);
 }
 
@@ -39,8 +39,8 @@
 
 __code assert3(struct Queue* queue) {
     SingleLinkedQueue* singleLinkedQueue = &queue->queue->Queue.queue->SingleLinkedQueue;
-    assert(singleLinkedQueue->top->data->Task.code == C_queueTest2);
-    assert(singleLinkedQueue->last->data->Task.code == C_queueTest2);
+    assert(singleLinkedQueue->top->data->Node.color == Black);
+    assert(singleLinkedQueue->last->data->Node.color == Black);
     goto meta(context, C_exit_code);
 }