/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | IntegerTest.java | 41 assertEquals("Returned incorrect byte value", -1, new Integer(65535) in test_byteValue() 43 assertEquals("Returned incorrect byte value", 127, new Integer(127) in test_byteValue() 52 assertTrue("-2 compared to 1 gave non-negative answer", new Integer(-2) in test_compareToLjava_lang_Integer() 53 .compareTo(new Integer(1)) < 0); in test_compareToLjava_lang_Integer() 54 assertEquals("-2 compared to -2 gave non-zero answer", 0, new Integer(-2) in test_compareToLjava_lang_Integer() 55 .compareTo(new Integer(-2))); in test_compareToLjava_lang_Integer() 56 assertTrue("3 compared to 2 gave non-positive answer", new Integer(3) in test_compareToLjava_lang_Integer() 57 .compareTo(new Integer(2)) > 0); in test_compareToLjava_lang_Integer() 60 new Integer(0).compareTo(null); in test_compareToLjava_lang_Integer() 73 132233, Integer.decode("132233").intValue()); in test_decodeLjava_lang_String2() [all …]
|
D | NumberTest.java | 28 ((byte) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_byteValue() 32 ((byte) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_byteValue() 36 ((byte) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_byteValue() 40 ((byte) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_byteValue() 50 ((short) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_shortValue() 54 ((short) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_shortValue() 58 ((short) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_shortValue() 62 ((short) Integer.valueOf(number).intValue()) == Integer.valueOf(number) in test_shortValue()
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | IntegerTest.java | 35 0x1_0000_0000L, (long) Integer.MIN_VALUE - 1L, Long.MIN_VALUE, Long.MAX_VALUE 45 assertNull("returned incorrect default Integer", Integer.getInteger("testIncInt")); in testSystemProperties() 46 assertEquals(new Integer(4), Integer.getInteger("testIncInt", 4)); in testSystemProperties() 47 assertEquals(new Integer(4), Integer.getInteger("testIncInt", new Integer(4))); in testSystemProperties() 55 final int min = Integer.MIN_VALUE; in testCompare() 57 final int max = Integer.MAX_VALUE; in testCompare() 58 assertTrue(Integer.compare(max, max) == 0); in testCompare() 59 assertTrue(Integer.compare(min, min) == 0); in testCompare() 60 assertTrue(Integer.compare(zero, zero) == 0); in testCompare() 61 assertTrue(Integer.compare(max, zero) > 0); in testCompare() [all …]
|
/libcore/ojluni/src/test/java/lang/String/CompactString/ |
D | Numbers.java | 49 { Integer.toBinaryString(Integer.MAX_VALUE), in numbers() 51 { Integer.toBinaryString(Integer.MIN_VALUE), in numbers() 53 { Integer.toBinaryString(7), "111" }, in numbers() 54 { Integer.toBinaryString(0), "0" }, in numbers() 55 { Integer.toOctalString(Integer.MAX_VALUE), "17777777777" }, in numbers() 56 { Integer.toOctalString(Integer.MIN_VALUE), "20000000000" }, in numbers() 57 { Integer.toOctalString(9), "11" }, in numbers() 58 { Integer.toOctalString(0), "0" }, in numbers() 59 { Integer.toHexString(Integer.MAX_VALUE), "7fffffff" }, in numbers() 60 { Integer.toHexString(Integer.MIN_VALUE), "80000000" }, in numbers() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/concurrent/ |
D | AtomicReferenceArrayTest.java | 31 private void checkArrayAsExpected(Integer[] expected, AtomicReferenceArray<Integer> actual) { in checkArrayAsExpected() 40 Integer[] expectedArray = { in testCompareAndExchange() 41 Integer.valueOf(42), in testCompareAndExchange() 42 Integer.valueOf(43), in testCompareAndExchange() 43 Integer.valueOf(44), in testCompareAndExchange() 44 Integer.valueOf(45) in testCompareAndExchange() 46 AtomicReferenceArray<Integer> arr = new AtomicReferenceArray(expectedArray); in testCompareAndExchange() 48 Integer val = Integer.valueOf(i+1); in testCompareAndExchange() 49 assertEquals(expectedArray[i], arr.compareAndExchange(i, Integer.valueOf(0), val)); in testCompareAndExchange() 58 val = Integer.valueOf(-1); in testCompareAndExchange() [all …]
|
D | AtomicReferenceTest.java | 33 Integer currentValue = Integer.valueOf(42); in testCompareAndExchange() 34 AtomicReference<Integer> val = new AtomicReference(currentValue); in testCompareAndExchange() 36 Integer notCurrent = new Integer(0); in testCompareAndExchange() 37 Integer newValue = Integer.valueOf(1); in testCompareAndExchange() 38 Integer result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange() 44 notCurrent = new Integer(42); in testCompareAndExchange() 59 notCurrent = new Integer(42); in testCompareAndExchange() 60 newValue = Integer.valueOf(0); in testCompareAndExchange() 67 newValue = Integer.valueOf(0); in testCompareAndExchange() 78 Integer currentValue = Integer.valueOf(42); in testCompareAndExchangeAcquire() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | RecursiveTaskTest.java | 135 void checkCompletesNormally(RecursiveTask<Integer> a, int expected) { in checkCompletesNormally() 136 Integer r = a.join(); in checkCompletesNormally() 145 void checkCompletedNormally(RecursiveTask<Integer> a, int expected) { in checkCompletedNormally() 146 Integer r = a.getRawResult(); in checkCompletedNormally() 215 static final Integer NoResult = Integer.valueOf(-17); 218 final class FibTask extends CheckedRecursiveTask<Integer> { 221 public Integer realCompute() { in realCompute() 230 public void publicSetRawResult(Integer result) { in publicSetRawResult() 236 final class FailingFibTask extends RecursiveTask<Integer> { 240 public Integer compute() { in compute() [all …]
|
D | Atomic8Test.java | 63 static Integer addInteger17(Integer x) { in addInteger17() 66 static Integer sumInteger(Integer x, Integer y) { in sumInteger() 72 volatile Integer anIntegerField; 84 AtomicReferenceFieldUpdater<Atomic8Test,Integer> anIntegerFieldUpdater() { in anIntegerFieldUpdater() 86 (Atomic8Test.class, Integer.class, "anIntegerField"); in anIntegerFieldUpdater() 160 assertEquals(1, a.getAndAccumulate(2, Integer::sum)); in testIntGetAndAccumulate() 161 assertEquals(3, a.getAndAccumulate(3, Integer::sum)); in testIntGetAndAccumulate() 171 assertEquals(7, a.accumulateAndGet(6, Integer::sum)); in testIntAccumulateAndGet() 172 assertEquals(10, a.accumulateAndGet(3, Integer::sum)); in testIntAccumulateAndGet() 181 AtomicReference<Integer> a = new AtomicReference<>(one); in testReferenceGetAndUpdate() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | RecursiveTaskTest.java | 112 void checkCompletesNormally(RecursiveTask<Integer> a, int expected) { in checkCompletesNormally() 113 Integer r = a.join(); in checkCompletesNormally() 122 void checkCompletedNormally(RecursiveTask<Integer> a, int expected) { in checkCompletedNormally() 123 Integer r = a.getRawResult(); in checkCompletedNormally() 192 static final Integer NoResult = Integer.valueOf(-17); 195 final class FibTask extends CheckedRecursiveTask<Integer> { 198 public Integer realCompute() { in realCompute() 207 public void publicSetRawResult(Integer result) { in publicSetRawResult() 213 final class FailingFibTask extends RecursiveTask<Integer> { 217 public Integer compute() { in compute() [all …]
|
D | Atomic8Test.java | 42 static Integer addInteger17(Integer x) { in addInteger17() 43 return Integer.valueOf(x.intValue() + 17); in addInteger17() 45 static Integer sumInteger(Integer x, Integer y) { in sumInteger() 46 return Integer.valueOf(x.intValue() + y.intValue()); in sumInteger() 51 volatile Integer anIntegerField; 63 AtomicReferenceFieldUpdater<Atomic8Test,Integer> anIntegerFieldUpdater() { in anIntegerFieldUpdater() 65 (Atomic8Test.class, Integer.class, "anIntegerField"); in anIntegerFieldUpdater() 139 assertEquals(1, a.getAndAccumulate(2, Integer::sum)); in testIntGetAndAccumulate() 140 assertEquals(3, a.getAndAccumulate(3, Integer::sum)); in testIntGetAndAccumulate() 150 assertEquals(7, a.accumulateAndGet(6, Integer::sum)); in testIntAccumulateAndGet() [all …]
|
/libcore/ojluni/src/test/java/util/Collections/ |
D | CheckedIdentityMap.java | 46 Map<Integer, Integer> m1 = checkedMap( in testHashCode() 47 new IdentityHashMap<Integer, Integer>(), in testHashCode() 48 Integer.class, Integer.class); in testHashCode() 49 Map<Integer, Integer> m2 = checkedMap( in testHashCode() 50 new IdentityHashMap<Integer, Integer>(), in testHashCode() 51 Integer.class, Integer.class); in testHashCode() 53 m1.put(new Integer(1), new Integer(1)); in testHashCode() 54 m2.put(new Integer(1), new Integer(1)); in testHashCode() 56 Map.Entry<Integer, Integer> e1 = m1.entrySet().iterator().next(); in testHashCode() 57 Map.Entry<Integer, Integer> e2 = m2.entrySet().iterator().next(); in testHashCode()
|
D | UnmodifiableMapEntrySet.java | 52 static <M extends Map<Integer, Integer>> M fillMap(int size, M m) { in fillMap() 69 (Supplier<Map<Integer, Integer>>) in mapCases() 73 (Supplier<Map<Integer, Integer>>) in mapCases() 80 static class EntryConsumer implements Consumer<Map.Entry<Integer, Integer>> { 83 public void accept(Map.Entry<Integer, Integer> me) { in accept() argument 85 me.setValue(Integer.MAX_VALUE); in accept() 103 public void testForEach(String d, Supplier<Map<Integer, Integer>> ms) { in testForEach() argument 109 public void testIteratorForEachRemaining(String d, Supplier<Map<Integer, Integer>> ms) { in testIteratorForEachRemaining() argument 115 public void testIteratorNext(String d, Supplier<Map<Integer, Integer>> ms) { in testIteratorNext() argument 117 for (Map.Entry<Integer, Integer> me : ms.get().entrySet()) { in testIteratorNext() [all …]
|
D | RacingCollections.java | 89 static final Integer one = 1; 90 static final Integer two = 2; 119 List<Integer> l = (List<Integer>) elLoco; in realRun() 130 Deque<Integer> q = (Deque<Integer>) elLoco; in realRun() 149 Queue<Integer> q = (Queue<Integer>) elLoco; in realRun() 160 Map<Integer, Boolean> m = (Map<Integer, Boolean>) elLoco; in realRun() 166 Collection<Integer> c = (Collection<Integer>) elLoco; in realRun() 211 Collection<Integer> c = (Collection<Integer>) theRock; in frob() 216 Map<Integer, Boolean> m = (Map<Integer, Boolean>) theRock; in frob() 227 private static List<Map<Integer, Boolean>> newConcurrentMaps() { in newConcurrentMaps() [all …]
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | NodeTest.java | 43 Integer[] array = new Integer[size]; in createSizes() 48 List<Node<Integer>> nodes = new ArrayList<>(); in createSizes() 52 … nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l.toArray(new Integer[l.size()])))); in createSizes() 66 Node<Integer> fill(Integer[] array, Node.Builder<Integer> nb) { in fill() 68 for (Integer i : array) { in fill() 75 Node<Integer> degenerateTree(Iterator<Integer> it) { in degenerateTree() 80 Integer i = it.next(); in degenerateTree() 82 return new Nodes.ConcNode<Integer>(Nodes.node(new Integer[] {i}), degenerateTree(it)); in degenerateTree() 85 return Nodes.node(new Integer[]{i}); in degenerateTree() 89 Node<Integer> tree(List<Integer> l, Function<List<Integer>, Node<Integer>> m) { in tree() argument [all …]
|
/libcore/ojluni/src/test/java/math/BigDecimal/ |
D | PowTests.java | 42 …{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(0), BigDecimal.valueOf(1, … in zeroAndOneTests() 43 …{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(1), BigDecimal.valueOf(0, … in zeroAndOneTests() 44 …{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(2), BigDecimal.valueOf(0, … in zeroAndOneTests() 45 …{BigDecimal.valueOf(0, Integer.MAX_VALUE), new BigDecimal(999999999), BigDecimal.valueOf(0, … in zeroAndOneTests() 47 …{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(0), BigDecimal.valueOf(1, … in zeroAndOneTests() 48 …{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(1), BigDecimal.valueOf(0, … in zeroAndOneTests() 49 …{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(2), BigDecimal.valueOf(0, … in zeroAndOneTests() 50 …{BigDecimal.valueOf(0, Integer.MIN_VALUE), new BigDecimal(999999999), BigDecimal.valueOf(0, … in zeroAndOneTests() 52 …{BigDecimal.valueOf(1, Integer.MAX_VALUE), new BigDecimal(0), BigDecimal.valueOf(1, … in zeroAndOneTests() 53 …{BigDecimal.valueOf(1, Integer.MAX_VALUE), new BigDecimal(1), BigDecimal.valueOf(1, … in zeroAndOneTests() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | OldAndroidArrayListTest.java | 34 array.add(Integer.valueOf(0)); in testArrayList() 35 array.add(0, Integer.valueOf(1)); in testArrayList() 36 array.add(1, Integer.valueOf(2)); in testArrayList() 37 array.add(Integer.valueOf(3)); in testArrayList() 38 array.add(Integer.valueOf(1)); in testArrayList() 43 assertEquals(1, ((Integer) array.get(0)).intValue()); in testArrayList() 44 assertEquals(2, ((Integer) array.get(1)).intValue()); in testArrayList() 45 assertEquals(0, ((Integer) array.get(2)).intValue()); in testArrayList() 46 assertEquals(3, ((Integer) array.get(3)).intValue()); in testArrayList() 47 assertEquals(1, ((Integer) array.get(4)).intValue()); in testArrayList() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | PriorityQueueTest.java | 48 PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(); in test_iterator() 49 Integer[] array = { 2, 45, 7, -12, 9 }; in test_iterator() 53 Iterator<Integer> iter = integerQueue.iterator(); in test_iterator() 55 ArrayList<Integer> iterResult = new ArrayList<Integer>(); in test_iterator() 69 PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(); in test_iterator_empty() 70 Iterator<Integer> iter = integerQueue.iterator(); in test_iterator_empty() 91 PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(); in test_iterator_outofbound() 93 Iterator<Integer> iter = integerQueue.iterator(); in test_iterator_outofbound() 117 PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(); in test_iterator_remove() 118 Integer[] array = { 2, 45, 7, -12, 9 }; in test_iterator_remove() [all …]
|
D | LinkedHashSetTest.java | 122 hs.add(Integer.valueOf(8)); in test_addLjava_lang_Object() 124 hs.add(Integer.valueOf(-9)); in test_addLjava_lang_Object() 127 assertTrue("Failed to add element to set", hs.contains(Integer.valueOf(-9))); in test_addLjava_lang_Object() 189 Integer ii = (Integer) oo; in test_iterator() 210 hs.remove(Integer.valueOf(98)); in test_removeLjava_lang_Object() 211 assertTrue("Failed to remove element", !hs.contains(Integer.valueOf(98))); in test_removeLjava_lang_Object() 237 LinkedHashSet<Integer> lhs = new LinkedHashSet<Integer>(); in test_retainAllLjava_util_Collection() 240 lhs.add(Integer.valueOf(1)); in test_retainAllLjava_util_Collection() 244 v = new Vector<Integer>(); in test_retainAllLjava_util_Collection() 245 v.add(Integer.valueOf(1)); in test_retainAllLjava_util_Collection() [all …]
|
/libcore/ojluni/src/test/java/util/LinkedHashMap/ |
D | Basic.java | 52 static final Integer nil = new Integer(0); 61 Map<Integer,Integer> m = new LinkedHashMap(); in testBasic() 62 Integer head = nil; in testBasic() 65 Integer newHead; in testBasic() 67 newHead = new Integer(rnd.nextInt()); in testBasic() 76 Map<Integer,Integer> m2 = new LinkedHashMap(); m2.putAll(m); in testBasic() 83 Integer newHead = m.get(head); in testBasic() 93 Map<Integer,Integer> m = new LinkedHashMap(); in testBasic() 95 Assert.assertEquals(m.put(new Integer(i), new Integer(2*i)), null); in testBasic() 97 Assert.assertEquals(m.containsValue(new Integer(i)), (i%2==0)); in testBasic() [all …]
|
/libcore/ojluni/src/test/java/lang/Integer/ |
D | Unsigned.java | 23 package test.java.lang.Integer; 42 Integer.parseUnsignedInt(Integer.toBinaryString(datum), 2), in testRoundtrip() 46 Assert.assertEquals(Integer.parseUnsignedInt(Integer.toOctalString(datum), 8), in testRoundtrip() 50 Assert.assertEquals(Integer.parseUnsignedInt(Integer.toHexString(datum), 16), in testRoundtrip() 99 int libraryResult = Integer.compareUnsigned(i, j); in testUnsignedCompare() 100 int libraryResultRev = Integer.compareUnsigned(j, i); in testUnsignedCompare() 110 Assert.assertEquals(Integer.signum(libraryResult), in testUnsignedCompare() 111 Integer.signum(localResult), in testUnsignedCompare() 116 Assert.assertEquals(Integer.signum(libraryResult), in testUnsignedCompare() 117 -Integer.signum(libraryResultRev), in testUnsignedCompare() [all …]
|
/libcore/support/src/test/java/tests/support/ |
D | Support_ListTest.java | 27 List<Integer> list; // must contain the Integers 0 to 99 in order 33 public Support_ListTest(String p1, List<Integer> l) { in Support_ListTest() 46 .equals(Integer.valueOf(counter))); in runTest() 50 list.add(50, Integer.valueOf(1000)); in runTest() 52 .get(50).equals(Integer.valueOf(1000))); in runTest() 55 list.get(51).equals(Integer.valueOf(50))); in runTest() 58 list.get(49).equals(Integer.valueOf(49))); in runTest() 60 list.set(50, Integer.valueOf(2000)); in runTest() 62 .equals(Integer.valueOf(2000))); in runTest() 64 list.get(51).equals(Integer.valueOf(50))); in runTest() [all …]
|
D | Support_CollectionTest.java | 27 Collection<Integer> col; // must contain the Integers 0 to 99 33 public Support_CollectionTest(String p1, Collection<Integer> c) { in Support_CollectionTest() 43 Collection<Integer> myCollection = new TreeSet<Integer>(); in runTest() 44 myCollection.add(Integer.valueOf(101)); in runTest() 45 myCollection.add(Integer.valueOf(102)); in runTest() 46 myCollection.add(Integer.valueOf(103)); in runTest() 49 assertTrue("CollectionTest - a) add did not work", col.add(new Integer( in runTest() 52 .contains(Integer.valueOf(101))); in runTest() 56 .remove(Integer.valueOf(101))); in runTest() 58 .contains(Integer.valueOf(101))); in runTest() [all …]
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | SequentialOpTest.java | 53 public void testLazy(String name, TestData.OfRef<Integer> data) { in testLazy() 54 Function<Integer, Integer> id = LambdaTestHelpers.identity(); in testLazy() 56 …Supplier<Stream<Integer>>[] suppliers = new Supplier[] { () -> data.stream(), () -> data.parallelS… in testLazy() 57 UnaryOperator<Stream<Integer>>[] configs in testLazy() 59 … (UnaryOperator<Stream<Integer>>) s -> s.peek(e -> { counter.incrementAndGet(); }), in testLazy() 60 …(UnaryOperator<Stream<Integer>>) s -> s.map(id).peek(e -> { counter.incrementAndGet(); }).sequenti… in testLazy() 61 …(UnaryOperator<Stream<Integer>>) s -> s.map(id).peek(e -> { counter.incrementAndGet(); }).parallel… in testLazy() 62 (UnaryOperator<Stream<Integer>>) s -> s.sequential().map(id).peek(e -> { in testLazy() 65 …(UnaryOperator<Stream<Integer>>) s -> s.parallel().map(id).peek(e -> { counter.incrementAndGet(); … in testLazy() 70 Supplier<Stream<Integer>> supp = suppliers[i]; in testLazy() [all …]
|
/libcore/ojluni/src/test/java/util/Collection/ |
D | CollectionDefaults.java | 66 public static final Predicate<Integer> pEven = x -> 0 == x % 2; 67 public static final Predicate<Integer> pOdd = x -> 1 == x % 2; 71 …private static final List<Function<Collection<Integer>, Collection<Integer>>> TEST_SUPPLIERS = Arr… 74 ExtendsAbstractCollection<Integer>::new, 75 java.util.ArrayDeque<Integer>::new, 76 java.util.concurrent.ConcurrentLinkedDeque<Integer>::new, 77 java.util.concurrent.ConcurrentLinkedQueue<Integer>::new, 78 java.util.concurrent.LinkedBlockingDeque<Integer>::new, 79 java.util.concurrent.LinkedBlockingQueue<Integer>::new, 80 java.util.concurrent.LinkedTransferQueue<Integer>::new, [all …]
|
/libcore/ojluni/src/main/java/java/net/ |
D | StandardSocketOptions.java | 115 public static final SocketOption<Integer> SO_SNDBUF = 116 new StdSocketOption<Integer>("SO_SNDBUF", Integer.class); 155 public static final SocketOption<Integer> SO_RCVBUF = 156 new StdSocketOption<Integer>("SO_RCVBUF", Integer.class); 241 public static final SocketOption<Integer> SO_LINGER = 242 new StdSocketOption<Integer>("SO_LINGER", Integer.class); 273 public static final SocketOption<Integer> IP_TOS = 274 new StdSocketOption<Integer>("IP_TOS", Integer.class); 323 public static final SocketOption<Integer> IP_MULTICAST_TTL = 324 new StdSocketOption<Integer>("IP_MULTICAST_TTL", Integer.class);
|