ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/DequeBash.java
(Generate patch)

Comparing jsr166/src/test/loops/DequeBash.java (file contents):
Revision 1.7 by jsr166, Tue Mar 15 19:47:05 2011 UTC vs.
Revision 1.12 by jsr166, Mon Aug 10 03:13:33 2015 UTC

# Line 3 | Line 3
3   * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
4   */
5  
6 import java.util.*;
6   import java.io.*;
7 + import java.util.*;
8  
9   /**
10   * Interface-based Deque tester.  This test currently makes three
# Line 22 | Line 22 | public class DequeBash {
22      static int nextHead = -1;
23      static int size() { return nextTail - nextHead - 1; }
24  
25
25      static int random(int bound) {
26          int x = seed;
27          int t = (x % 127773) * 16807 - (x / 127773) * 2836;
# Line 37 | Line 36 | public class DequeBash {
36          return (t & 0x7fffffff);
37      }
38  
39 <    public static void main(String args[]) throws Exception {
39 >    public static void main(String[] args) throws Exception {
40          Class<?> cls = Class.forName(args[0]);
41          int n = 1000000;
42  
# Line 53 | Line 52 | public class DequeBash {
52              System.out.printf("Time: %d ms%n", elapsedTimeMillis);
53              if (deque.isEmpty()) System.out.print(" ");
54          }
56
55      }
56  
57      static void mainTest(Deque<Integer> deque, int n) throws Exception {
# Line 80 | Line 78 | public class DequeBash {
78              // Test fancy removal stuff once in a blue moon
79              if ((i & 8191) == 0)
80                  testRemove(deque);
81 <
84 <         }
81 >        }
82  
83          // Stupid tests for clear, toString
84          deque.clear();
# Line 154 | Line 151 | public class DequeBash {
151                                  deque.getLast() + " expecting " + (nextTail - 1));
152      }
153  
157
154      static void randomOp(Deque<Integer> deque) throws Exception {
155  
156          // Perform a random operation
# Line 231 | Line 227 | public class DequeBash {
227          }
228      }
229  
234
230      private static void testEqual(Deque<Integer> d1, Deque<Integer> d2)
231          throws Exception
232      {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines