Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added test for dequeueing 200 times from a 4 item queue.

  • Loading branch information...
commit 5a1760837299bed8c94270d2b9b93ecd60785ee7 1 parent 40fecb3
Corey Leigh Latislaw authored December 12, 2011
16  Java/Queue/test/com/colabug/queue/QueueTest.java
@@ -131,4 +131,20 @@ public void testDequeueFromArbitraryQueue()
131 131
         assertEquals( data3, integerQueue.front() );
132 132
         assertEquals( data4, integerQueue.back() );
133 133
     }
  134
+
  135
+    @Test
  136
+    public void testDequeueingManyMoreTimesThanItems()
  137
+    {
  138
+        // Populate queue
  139
+        populateArbitraryQueue();
  140
+
  141
+        // Dequeue a lot
  142
+        for ( int i = 0; i < 200; i++ )
  143
+        {
  144
+            integerQueue.dequeue();
  145
+        }
  146
+
  147
+        // Verify empty
  148
+        assertTrue( integerQueue.isEmpty() );
  149
+    }
134 150
 }

0 notes on commit 5a17608

Please sign in to comment.
Something went wrong with that request. Please try again.