Home
last modified time | relevance | path

Searched refs:q (Results 1 – 25 of 125) sorted by relevance

12345

/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentLinkedDequeTest.java72 ConcurrentLinkedDeque<Integer> q = new ConcurrentLinkedDeque<>(); in populatedDeque() local
73 assertTrue(q.isEmpty()); in populatedDeque()
75 assertTrue(q.offer(new Integer(i))); in populatedDeque()
76 assertFalse(q.isEmpty()); in populatedDeque()
77 assertEquals(n, q.size()); in populatedDeque()
78 assertEquals((Integer) 0, q.peekFirst()); in populatedDeque()
79 assertEquals((Integer) (n - 1), q.peekLast()); in populatedDeque()
80 return q; in populatedDeque()
131 ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints)); in testConstructor6() local
133 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DLinkedListTest.java75 LinkedList<Integer> q = new LinkedList<>(); in populatedQueue() local
76 assertTrue(q.isEmpty()); in populatedQueue()
78 assertTrue(q.offer(new Integer(i))); in populatedQueue()
79 assertFalse(q.isEmpty()); in populatedQueue()
80 assertEquals(n, q.size()); in populatedQueue()
81 assertEquals((Integer) 0, q.peekFirst()); in populatedQueue()
82 assertEquals((Integer) (n - 1), q.peekLast()); in populatedQueue()
83 return q; in populatedQueue()
110 LinkedList q = new LinkedList(Arrays.asList(ints)); in testConstructor6() local
112 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DArrayDequeTest.java74 final ArrayDeque<Integer> q; in populatedDeque() local
77 case 0: q = new ArrayDeque<Integer>(); break; in populatedDeque()
78 case 1: q = new ArrayDeque<Integer>(0); break; in populatedDeque()
79 case 2: q = new ArrayDeque<Integer>(1); break; in populatedDeque()
80 case 3: q = new ArrayDeque<Integer>(Math.max(0, n - 1)); break; in populatedDeque()
81 case 4: q = new ArrayDeque<Integer>(n); break; in populatedDeque()
82 case 5: q = new ArrayDeque<Integer>(n + 1); break; in populatedDeque()
87 q.addFirst(42); in populatedDeque()
88 assertEquals((Integer) 42, q.removeLast()); in populatedDeque()
91 q.addLast(42); in populatedDeque()
[all …]
DLinkedTransferQueueTest.java135 LinkedTransferQueue q in testConstructor5() local
137 assertEquals(q.size(), intList.size()); in testConstructor5()
138 assertEquals(q.toString(), intList.toString()); in testConstructor5()
139 assertTrue(Arrays.equals(q.toArray(), in testConstructor5()
141 assertTrue(Arrays.equals(q.toArray(new Object[0]), in testConstructor5()
143 assertTrue(Arrays.equals(q.toArray(new Object[SIZE]), in testConstructor5()
146 assertEquals(ints[i], q.poll()); in testConstructor5()
154 BlockingQueue q = populatedQueue(SIZE); in testRemainingCapacity() local
156 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in testRemainingCapacity()
157 assertEquals(SIZE - i, q.size()); in testRemainingCapacity()
[all …]
DConcurrentLinkedQueueTest.java70 ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<>(); in populatedQueue() local
71 assertTrue(q.isEmpty()); in populatedQueue()
73 assertTrue(q.offer(new Integer(i))); in populatedQueue()
74 assertFalse(q.isEmpty()); in populatedQueue()
75 assertEquals(n, q.size()); in populatedQueue()
76 assertEquals((Integer) 0, q.peek()); in populatedQueue()
77 return q; in populatedQueue()
127 ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints)); in testConstructor6() local
129 assertEquals(ints[i], q.poll()); in testConstructor6()
136 ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(); in testEmpty() local
[all …]
DLinkedBlockingDequeTest.java90 LinkedBlockingDeque<Integer> q = in populatedDeque() local
92 assertTrue(q.isEmpty()); in populatedDeque()
94 assertTrue(q.offer(new Integer(i))); in populatedDeque()
95 assertFalse(q.isEmpty()); in populatedDeque()
96 assertEquals(0, q.remainingCapacity()); in populatedDeque()
97 assertEquals(n, q.size()); in populatedDeque()
98 assertEquals((Integer) 0, q.peekFirst()); in populatedDeque()
99 assertEquals((Integer) (n - 1), q.peekLast()); in populatedDeque()
100 return q; in populatedDeque()
107 LinkedBlockingDeque q = new LinkedBlockingDeque(); in testEmpty() local
[all …]
DDelayQueueTest.java147 DelayQueue<PDelay> q = new DelayQueue<>(); in populatedQueue() local
148 assertTrue(q.isEmpty()); in populatedQueue()
150 assertTrue(q.offer(new PDelay(i))); in populatedQueue()
152 assertTrue(q.offer(new PDelay(i))); in populatedQueue()
153 assertFalse(q.isEmpty()); in populatedQueue()
154 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in populatedQueue()
155 assertEquals(n, q.size()); in populatedQueue()
156 assertEquals(new PDelay(0), q.peek()); in populatedQueue()
157 return q; in populatedQueue()
207 DelayQueue q = new DelayQueue(Arrays.asList(ints)); in testConstructor6() local
[all …]
DPriorityQueueTest.java75 PriorityQueue<Integer> q = new PriorityQueue<>(n); in populatedQueue() local
76 assertTrue(q.isEmpty()); in populatedQueue()
78 assertTrue(q.offer(new Integer(i))); in populatedQueue()
80 assertTrue(q.offer(new Integer(i))); in populatedQueue()
81 assertFalse(q.isEmpty()); in populatedQueue()
82 assertEquals(n, q.size()); in populatedQueue()
83 assertEquals((Integer) 0, q.peek()); in populatedQueue()
84 return q; in populatedQueue()
144 PriorityQueue q = new PriorityQueue(Arrays.asList(ints)); in testConstructor6() local
146 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DLinkedBlockingQueueTest.java90 LinkedBlockingQueue<Integer> q = in populatedQueue() local
92 assertTrue(q.isEmpty()); in populatedQueue()
94 assertTrue(q.offer(new Integer(i))); in populatedQueue()
95 assertFalse(q.isEmpty()); in populatedQueue()
96 assertEquals(0, q.remainingCapacity()); in populatedQueue()
97 assertEquals(n, q.size()); in populatedQueue()
98 assertEquals((Integer) 0, q.peek()); in populatedQueue()
99 return q; in populatedQueue()
164 LinkedBlockingQueue q = new LinkedBlockingQueue(Arrays.asList(ints)); in testConstructor6() local
166 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DPriorityBlockingQueueTest.java98 PriorityBlockingQueue<Integer> q = in populatedQueue() local
100 assertTrue(q.isEmpty()); in populatedQueue()
102 assertTrue(q.offer(new Integer(i))); in populatedQueue()
104 assertTrue(q.offer(new Integer(i))); in populatedQueue()
105 assertFalse(q.isEmpty()); in populatedQueue()
106 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in populatedQueue()
107 assertEquals(n, q.size()); in populatedQueue()
108 assertEquals((Integer) 0, q.peek()); in populatedQueue()
109 return q; in populatedQueue()
172 PriorityBlockingQueue q = new PriorityBlockingQueue(Arrays.asList(ints)); in testConstructor6() local
[all …]
DArrayBlockingQueueTest.java108 ArrayBlockingQueue<Integer> q = new ArrayBlockingQueue<>(capacity); in populatedQueue() local
109 assertTrue(q.isEmpty()); in populatedQueue()
113 for (int i = 0; i < n; i++) q.add(42); in populatedQueue()
114 for (int i = 0; i < n; i++) q.remove(); in populatedQueue()
117 assertTrue(q.offer((Integer) i)); in populatedQueue()
118 assertEquals(size == 0, q.isEmpty()); in populatedQueue()
119 assertEquals(capacity - size, q.remainingCapacity()); in populatedQueue()
120 assertEquals(size, q.size()); in populatedQueue()
122 assertEquals((Integer) 0, q.peek()); in populatedQueue()
123 return q; in populatedQueue()
[all …]
DConcurrentSkipListSubSetTest.java64 ConcurrentSkipListSet<Integer> q = in populatedSet() local
66 assertTrue(q.isEmpty()); in populatedSet()
69 assertTrue(q.add(new Integer(i))); in populatedSet()
71 assertTrue(q.add(new Integer(i))); in populatedSet()
72 assertTrue(q.add(new Integer(-n))); in populatedSet()
73 assertTrue(q.add(new Integer(n))); in populatedSet()
74 NavigableSet s = q.subSet(new Integer(0), true, new Integer(n), false); in populatedSet()
84 ConcurrentSkipListSet q = new ConcurrentSkipListSet(); in set5() local
85 assertTrue(q.isEmpty()); in set5()
86 q.add(one); in set5()
[all …]
DTreeSubSetTest.java65 TreeSet<Integer> q = new TreeSet<>(); in populatedSet() local
66 assertTrue(q.isEmpty()); in populatedSet()
69 assertTrue(q.add(new Integer(i))); in populatedSet()
71 assertTrue(q.add(new Integer(i))); in populatedSet()
72 assertTrue(q.add(new Integer(-n))); in populatedSet()
73 assertTrue(q.add(new Integer(n))); in populatedSet()
74 NavigableSet s = q.subSet(new Integer(0), true, new Integer(n), false); in populatedSet()
84 TreeSet q = new TreeSet(); in set5() local
85 assertTrue(q.isEmpty()); in set5()
86 q.add(one); in set5()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentLinkedDequeTest.java40 ConcurrentLinkedDeque<Integer> q = new ConcurrentLinkedDeque<Integer>(); in populatedDeque() local
41 assertTrue(q.isEmpty()); in populatedDeque()
43 assertTrue(q.offer(new Integer(i))); in populatedDeque()
44 assertFalse(q.isEmpty()); in populatedDeque()
45 assertEquals(n, q.size()); in populatedDeque()
46 return q; in populatedDeque()
97 ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints)); in testConstructor6() local
99 assertEquals(ints[i], q.poll()); in testConstructor6()
106 ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(); in testEmpty() local
107 assertTrue(q.isEmpty()); in testEmpty()
[all …]
DLinkedListTest.java36 LinkedList<Integer> q = new LinkedList<Integer>(); in populatedQueue() local
37 assertTrue(q.isEmpty()); in populatedQueue()
39 assertTrue(q.offer(new Integer(i))); in populatedQueue()
40 assertFalse(q.isEmpty()); in populatedQueue()
41 assertEquals(n, q.size()); in populatedQueue()
42 return q; in populatedQueue()
69 LinkedList q = new LinkedList(Arrays.asList(ints)); in testConstructor6() local
71 assertEquals(ints[i], q.poll()); in testConstructor6()
78 LinkedList q = new LinkedList(); in testEmpty() local
79 assertTrue(q.isEmpty()); in testEmpty()
[all …]
DArrayDequeTest.java37 ArrayDeque<Integer> q = new ArrayDeque<Integer>(); in populatedDeque() local
38 assertTrue(q.isEmpty()); in populatedDeque()
40 assertTrue(q.offerLast(new Integer(i))); in populatedDeque()
41 assertFalse(q.isEmpty()); in populatedDeque()
42 assertEquals(n, q.size()); in populatedDeque()
43 return q; in populatedDeque()
93 ArrayDeque q = new ArrayDeque(Arrays.asList(ints)); in testConstructor6() local
95 assertEquals(ints[i], q.pollFirst()); in testConstructor6()
102 ArrayDeque q = new ArrayDeque(); in testEmpty() local
103 assertTrue(q.isEmpty()); in testEmpty()
[all …]
DLinkedTransferQueueTest.java117 LinkedTransferQueue q in testConstructor5() local
119 assertEquals(q.size(), intList.size()); in testConstructor5()
120 assertEquals(q.toString(), intList.toString()); in testConstructor5()
121 assertTrue(Arrays.equals(q.toArray(), in testConstructor5()
123 assertTrue(Arrays.equals(q.toArray(new Object[0]), in testConstructor5()
125 assertTrue(Arrays.equals(q.toArray(new Object[SIZE]), in testConstructor5()
128 assertEquals(ints[i], q.poll()); in testConstructor5()
136 BlockingQueue q = populatedQueue(SIZE); in testRemainingCapacity() local
138 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in testRemainingCapacity()
139 assertEquals(SIZE - i, q.size()); in testRemainingCapacity()
[all …]
DConcurrentLinkedQueueTest.java38 ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<Integer>(); in populatedQueue() local
39 assertTrue(q.isEmpty()); in populatedQueue()
41 assertTrue(q.offer(new Integer(i))); in populatedQueue()
42 assertFalse(q.isEmpty()); in populatedQueue()
43 assertEquals(n, q.size()); in populatedQueue()
44 return q; in populatedQueue()
94 ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints)); in testConstructor6() local
96 assertEquals(ints[i], q.poll()); in testConstructor6()
103 ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(); in testEmpty() local
104 assertTrue(q.isEmpty()); in testEmpty()
[all …]
DLinkedBlockingQueueTest.java61 LinkedBlockingQueue<Integer> q = in populatedQueue() local
63 assertTrue(q.isEmpty()); in populatedQueue()
65 assertTrue(q.offer(new Integer(i))); in populatedQueue()
66 assertFalse(q.isEmpty()); in populatedQueue()
67 assertEquals(0, q.remainingCapacity()); in populatedQueue()
68 assertEquals(n, q.size()); in populatedQueue()
69 return q; in populatedQueue()
134 LinkedBlockingQueue q = new LinkedBlockingQueue(Arrays.asList(ints)); in testConstructor6() local
136 assertEquals(ints[i], q.poll()); in testConstructor6()
143 LinkedBlockingQueue q = new LinkedBlockingQueue(2); in testEmptyFull() local
[all …]
DLinkedBlockingDequeTest.java58 LinkedBlockingDeque<Integer> q = in populatedDeque() local
60 assertTrue(q.isEmpty()); in populatedDeque()
62 assertTrue(q.offer(new Integer(i))); in populatedDeque()
63 assertFalse(q.isEmpty()); in populatedDeque()
64 assertEquals(0, q.remainingCapacity()); in populatedDeque()
65 assertEquals(n, q.size()); in populatedDeque()
66 return q; in populatedDeque()
73 LinkedBlockingDeque q = new LinkedBlockingDeque(); in testEmpty() local
74 assertTrue(q.isEmpty()); in testEmpty()
75 q.add(new Integer(1)); in testEmpty()
[all …]
DPriorityQueueTest.java44 PriorityQueue<Integer> q = new PriorityQueue<Integer>(n); in populatedQueue() local
45 assertTrue(q.isEmpty()); in populatedQueue()
47 assertTrue(q.offer(new Integer(i))); in populatedQueue()
49 assertTrue(q.offer(new Integer(i))); in populatedQueue()
50 assertFalse(q.isEmpty()); in populatedQueue()
51 assertEquals(n, q.size()); in populatedQueue()
52 return q; in populatedQueue()
112 PriorityQueue q = new PriorityQueue(Arrays.asList(ints)); in testConstructor6() local
114 assertEquals(ints[i], q.poll()); in testConstructor6()
122 PriorityQueue q = new PriorityQueue(SIZE, cmp); in testConstructor7() local
[all …]
DPriorityBlockingQueueTest.java69 PriorityBlockingQueue<Integer> q = in populatedQueue() local
71 assertTrue(q.isEmpty()); in populatedQueue()
73 assertTrue(q.offer(new Integer(i))); in populatedQueue()
75 assertTrue(q.offer(new Integer(i))); in populatedQueue()
76 assertFalse(q.isEmpty()); in populatedQueue()
77 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in populatedQueue()
78 assertEquals(n, q.size()); in populatedQueue()
79 return q; in populatedQueue()
142 PriorityBlockingQueue q = new PriorityBlockingQueue(Arrays.asList(ints)); in testConstructor6() local
144 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DDelayQueueTest.java140 DelayQueue<PDelay> q = new DelayQueue<PDelay>(); in populatedQueue() local
141 assertTrue(q.isEmpty()); in populatedQueue()
143 assertTrue(q.offer(new PDelay(i))); in populatedQueue()
145 assertTrue(q.offer(new PDelay(i))); in populatedQueue()
146 assertFalse(q.isEmpty()); in populatedQueue()
147 assertEquals(Integer.MAX_VALUE, q.remainingCapacity()); in populatedQueue()
148 assertEquals(n, q.size()); in populatedQueue()
149 return q; in populatedQueue()
199 DelayQueue q = new DelayQueue(Arrays.asList(ints)); in testConstructor6() local
201 assertEquals(ints[i], q.poll()); in testConstructor6()
[all …]
DArrayBlockingQueueTest.java61 ArrayBlockingQueue<Integer> q = new ArrayBlockingQueue<Integer>(n); in populatedQueue() local
62 assertTrue(q.isEmpty()); in populatedQueue()
64 assertTrue(q.offer(new Integer(i))); in populatedQueue()
65 assertFalse(q.isEmpty()); in populatedQueue()
66 assertEquals(0, q.remainingCapacity()); in populatedQueue()
67 assertEquals(n, q.size()); in populatedQueue()
68 return q; in populatedQueue()
145 ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE, true, elements); in testConstructor7() local
147 assertEquals(ints[i], q.poll()); in testConstructor7()
154 ArrayBlockingQueue q = new ArrayBlockingQueue(2); in testEmptyFull() local
[all …]
DConcurrentSkipListSubSetTest.java41 ConcurrentSkipListSet<Integer> q = in populatedSet() local
43 assertTrue(q.isEmpty()); in populatedSet()
46 assertTrue(q.add(new Integer(i))); in populatedSet()
48 assertTrue(q.add(new Integer(i))); in populatedSet()
49 assertTrue(q.add(new Integer(-n))); in populatedSet()
50 assertTrue(q.add(new Integer(n))); in populatedSet()
51 NavigableSet s = q.subSet(new Integer(0), true, new Integer(n), false); in populatedSet()
61 ConcurrentSkipListSet q = new ConcurrentSkipListSet(); in set5() local
62 assertTrue(q.isEmpty()); in set5()
63 q.add(one); in set5()
[all …]

12345