Project 2 Test Cases
- *** Testing object storage...(10 pts)
Initialize a long so that nearly all bits are set,
Call Enqueue() and give it the long as a pointer,
Call Dequeue() and check that the pointer returned
is equal to the long.
- *** Testing probe on empty queue...(2.5 pts)
Call Probe() on an empty queue
- *** Testing head on empty queue...(2.5 pts)
Call Head() on an empty queue
- *** Testing probe on non-empty queue...(5 pts)
Call Probe() on an queue with one item.
- *** Testing head on non-empty queue...(5 pts)
Call Head() on an queue with one item.
- *** First test of reading and writing...(15 pts)
Create two queues, each with maxItems of 5. Simultaneously enqueue
to first queue, dequeue from the first queue and enqueue what was
dequeued into the second queue, and dequeue from the second queue.
Compare the sum of all the values enqueued to the first queue and
dequeued from the second queue
- *** Second test of reading and writing...(15 pts)
Simultaneously Enqueue(), Dequeue() of integers 0 to 9999 on
queue with maxitems of 100. Compare the sum of all the
values enqueued and dequeue
- *** Testing timeouts...(10 pts)
Call Dequeue() with a three second timeout three times on
one empty queue.
- *** Test that probe and head unlock the mutex on an empty queue...( 5 pts)
Call Probe() and Head() twice each on the same queue.