4 #include "mpsc_queue.c"
6 void noopFreer(void* _) { }
8 bool test_single_threaded()
11 initializeMPSCQueue(&queue);
13 int inputs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
15 for(int i = 0; i < 10; i++)
17 enqueue(&queue, &(inputs[i]));
23 while(!isEmpty(&queue))
25 outputs[index++] = dequeue(&queue);
28 for(int i = 0; i < 10; i++)
30 assert(i == *(outputs[i]));
33 freeMPSCQueue(&queue, noopFreer);
38 int main(int argc, char** argv)
41 bool (*tests[TEST_COUNT])() = {
45 for(int i = 0; i < TEST_COUNT; i++)