#include "../../context.h" #include __code queueTest1(struct Queue* queue) { queue->queue = (union Data*)createSingleLinkedQueue(context); 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->Node.color == Red); assert(singleLinkedQueue->last->data->Node.color == Red); goto meta(context, C_queueTest2); } __code queueTest2(struct Queue* queue) { 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->Node.color == Red); assert(singleLinkedQueue->last->data->Node.color == Black); goto meta(context, C_queueTest3); } __code queueTest3(struct Queue* queue) { queue->next = C_assert3; goto meta(context, queue->queue->Queue.take); } __code assert3(struct Queue* queue) { SingleLinkedQueue* singleLinkedQueue = &queue->queue->Queue.queue->SingleLinkedQueue; assert(singleLinkedQueue->top->data->Node.color == Black); assert(singleLinkedQueue->last->data->Node.color == Black); goto meta(context, C_exit_code); } int main(int argc, char const* argv[]) { struct Context* main_context = NEW(struct Context); initContext(main_context); main_context->next = C_queueTest1; goto start_code(main_context); }