Mercurial > hg > GearsTemplate
changeset 215:50d0d1b468aa
Fix stack_test
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 06 Jan 2017 06:48:59 +0900 |
parents | da8ca04eb4f3 |
children | 6578c5c274ba |
files | src/parallel_execution/test/stack_test.c |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/test/stack_test.c Fri Jan 06 05:51:23 2017 +0900 +++ b/src/parallel_execution/test/stack_test.c Fri Jan 06 06:48:59 2017 +0900 @@ -2,13 +2,14 @@ #include "../context.h" #include "../origin_cs.h" #include <assert.h> + extern __code initContext(struct Context* context); __code stack_test1(struct Context* context, struct Task* task, struct Stack* stack) { task->code = C_stack_test1; stack->next = C_stack_test2; stack->data = (union Data*)task; - goto meta(context, stack->push); + goto meta(context, stack->stack->Stack.push); } __code stack_test1_stub(struct Context* context) { @@ -18,14 +19,14 @@ context->data[D_Stack]->Stack.stack = (union Data*)stack; goto stack_test1(context, task, - &context->data[D_Stack]->Stack.stack->Stack); + &context->data[D_Stack]->Stack); } __code stack_test2(struct Context* context, struct Task* task, struct Stack* stack) { task->code = C_stack_test2; stack->next = C_stack_test3; stack->data = (union Data*)task; - goto meta(context, stack->push); + goto meta(context, stack->stack->Stack.push); } __code stack_test2_stub(struct Context* context) { @@ -33,27 +34,26 @@ Task* task = &ALLOCATE(context, Task)->Task; goto stack_test2(context, task, - &context->data[D_Stack]->Stack.stack->Stack); + &context->data[D_Stack]->Stack); } __code stack_test3(struct Context* context, struct Stack* stack) { stack->next = C_stack_test4; - goto meta(context, stack->pop); + goto meta(context, stack->stack->Stack.pop); } __code stack_test3_stub(struct Context* context) { assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test2); - assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test1); goto stack_test3(context, - &context->data[D_Stack]->Stack.stack->Stack); + &context->data[D_Stack]->Stack); } __code stack_test4(struct Context* context) { - goto meta(context, exit_code); + goto meta(context, C_exit_code); } __code stack_test4_stub(struct Context* context) { - assert(context->data[D_Stack]->Stack.stack->Stack.data->Task.code == C_stack_test1); + assert(context->data[D_Stack]->Stack.data->Task.code == C_stack_test2); assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test1); goto stack_test4(context); }