| 213 | #ifdef LLQUEUE_MAIN |
| 214 | |
| 215 | void * |
| 216 | testfun(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. |
nothing calls this directly
no test coverage detected