#include "../../context.h" #include __code queueTest1(struct Queue* queue) { Node* node = new Node(); node->color = Red; goto queue->put(node, queueTest2); } __code queueTest1_stub(struct Context* context) { Queue* queue = createSingleLinkedQueue(context); goto queueTest1(context, queue); } __code queueTest2(struct Queue* queue) { Node* node = new Node(); node->color = Black; goto queue->put(node, queueTest3); } __code queueTest2_stub(struct Context* context) { SingleLinkedQueue* singleLinkedQueue = (SingleLinkedQueue*)GearImpl(context, Queue, queue); assert(singleLinkedQueue->top->next->data->Node.color == Red); assert(singleLinkedQueue->last->data->Node.color == Red); Queue* queue = (struct Queue*)Gearef(context, Queue)->queue; goto queueTest2(context, queue); } __code queueTest3(struct Queue* queue) { goto queue->take(assert3); } __code queueTest3_stub(struct Context* context) { SingleLinkedQueue* singleLinkedQueue = (SingleLinkedQueue*)GearImpl(context, Queue, queue); assert(singleLinkedQueue->top->next->data->Node.color == Red); assert(singleLinkedQueue->last->data->Node.color == Black); Queue* queue = (struct Queue*)Gearef(context, Queue)->queue; goto queueTest3(context, queue); } __code assert3(struct Queue* queue) { SingleLinkedQueue* singleLinkedQueue = &queue->queue->Queue.queue->SingleLinkedQueue; assert(singleLinkedQueue->top->next->data->Node.color == Black); assert(singleLinkedQueue->last->data->Node.color == Black); goto exit_code(context); } int main(int argc, char const* argv[]) { goto queueTest1(); }