MCPcopy Create free account
hub / github.com/apache/trafficserver / testfun

Function testfun

src/tscore/llqueue.cc:215–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213#ifdef LLQUEUE_MAIN
214
215void *
216testfun(void *unused)
217{
218 int num;
219 LLQ *Q;
220
221 Q = create_queue();
222 assert(Q);
223
224 do {
225 scanf("%d", &num);
226 if (num == 0) {
227 printf("DEQUEUE: %d\n", (int)dequeue(Q));
228 } else if (num == -1) {
229 printf("queue_is_empty: %d\n", queue_is_empty(Q));
230 } else {
231 printf("enqueue: %d\n", num);
232 enqueue(Q, (void *)num);
233 }
234 } while (num >= -1);
235
236 return nullptr;
237}
238
239/*
240 * test harness-- hit Ctrl-C if it blocks or you get tired.

Callers

nothing calls this directly

Calls 4

create_queueFunction · 0.85
dequeueFunction · 0.85
queue_is_emptyFunction · 0.85
enqueueFunction · 0.85

Tested by

no test coverage detected