Mercurial > hg > Members > Moririn
changeset 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 | 01e0fa598ce3 |
children | 3529c7e93c4f 98c6e13d8ec7 |
files | src/parallel_execution/test/queue_test.cbc src/parallel_execution/test/stack_test.cbc |
diffstat | 2 files changed, 21 insertions(+), 21 deletions(-) [+] |
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); }
--- a/src/parallel_execution/test/stack_test.cbc Wed Jun 07 13:46:00 2017 +0900 +++ b/src/parallel_execution/test/stack_test.cbc Wed Jun 07 15:17:36 2017 +0900 @@ -3,30 +3,30 @@ __code stackTest1(struct Stack* stack) { stack->stack = (union Data*)createSingleLinkedStack(context); - Task* task = new Task(); - task->code = C_stackTest1; - stack->data = (union Data*)task; + Node* node = new Node(); + node->color = Red; + stack->data = (union Data*)node; stack->next = C_assert1; goto meta(context, stack->stack->Stack.push); } __code assert1(struct Stack* stack) { SingleLinkedStack* singleLinkedStack = &stack->stack->Stack.stack->SingleLinkedStack; - assert(singleLinkedStack->top->data->Task.code == C_stackTest1); + assert(singleLinkedStack->top->data->Node.color == Red); goto meta(context, C_stackTest2); } __code stackTest2(struct Stack* stack) { - Task* task = new Task(); - task->code = C_stackTest2; - stack->data = (union Data*)task; + Node* node = new Node(); + node->color = Black; + stack->data = (union Data*)node; stack->next = C_assert2; goto meta(context, stack->stack->Stack.push); } __code assert2(struct Stack* stack) { SingleLinkedStack* singleLinkedStack = &stack->stack->Stack.stack->SingleLinkedStack; - assert(singleLinkedStack->top->data->Task.code == C_stackTest2); + assert(singleLinkedStack->top->data->Node.color == Black); goto meta(context, C_stackTest3); } @@ -38,7 +38,7 @@ __code assert3(struct Stack* stack) { SingleLinkedStack* singleLinkedStack = &stack->stack->Stack.stack->SingleLinkedStack; - assert(singleLinkedStack->top->data->Task.code == C_stackTest1); + assert(singleLinkedStack->top->data->Node.color == Red); goto meta(context, C_exit_code); }