Home
last modified time | relevance | path

Searched refs:ai (Results 1 – 25 of 30) sorted by relevance

12

/libcore/jsr166-tests/src/test/java/jsr166/
DAtomicIntegerTest.java35 AtomicInteger ai = new AtomicInteger(1); in testConstructor() local
36 assertEquals(1, ai.get()); in testConstructor()
43 AtomicInteger ai = new AtomicInteger(); in testConstructor2() local
44 assertEquals(0, ai.get()); in testConstructor2()
51 AtomicInteger ai = new AtomicInteger(1); in testGetSet() local
52 assertEquals(1, ai.get()); in testGetSet()
53 ai.set(2); in testGetSet()
54 assertEquals(2, ai.get()); in testGetSet()
55 ai.set(-3); in testGetSet()
56 assertEquals(-3, ai.get()); in testGetSet()
[all …]
DAtomicLongTest.java37 AtomicLong ai = new AtomicLong(1); in testConstructor() local
38 assertEquals(1, ai.get()); in testConstructor()
45 AtomicLong ai = new AtomicLong(); in testConstructor2() local
46 assertEquals(0, ai.get()); in testConstructor2()
53 AtomicLong ai = new AtomicLong(1); in testGetSet() local
54 assertEquals(1, ai.get()); in testGetSet()
55 ai.set(2); in testGetSet()
56 assertEquals(2, ai.get()); in testGetSet()
57 ai.set(-3); in testGetSet()
58 assertEquals(-3, ai.get()); in testGetSet()
[all …]
DAtomicBooleanTest.java39 AtomicBoolean ai = new AtomicBoolean(); in testConstructor2() local
40 assertFalse(ai.get()); in testConstructor2()
47 AtomicBoolean ai = new AtomicBoolean(true); in testGetSet() local
48 assertTrue(ai.get()); in testGetSet()
49 ai.set(false); in testGetSet()
50 assertFalse(ai.get()); in testGetSet()
51 ai.set(true); in testGetSet()
52 assertTrue(ai.get()); in testGetSet()
59 AtomicBoolean ai = new AtomicBoolean(true); in testGetLazySet() local
60 assertTrue(ai.get()); in testGetLazySet()
[all …]
DLongAdderTest.java32 LongAdder ai = new LongAdder(); in testConstructor() local
33 assertEquals(0, ai.sum()); in testConstructor()
40 LongAdder ai = new LongAdder(); in testAddAndSum() local
41 ai.add(2); in testAddAndSum()
42 assertEquals(2, ai.sum()); in testAddAndSum()
43 ai.add(-4); in testAddAndSum()
44 assertEquals(-2, ai.sum()); in testAddAndSum()
51 LongAdder ai = new LongAdder(); in testDecrementAndsum() local
52 ai.decrement(); in testDecrementAndsum()
53 assertEquals(-1, ai.sum()); in testDecrementAndsum()
[all …]
DAtomicMarkableReferenceTest.java31 AtomicMarkableReference ai = new AtomicMarkableReference(one, false); in testConstructor() local
32 assertSame(one, ai.getReference()); in testConstructor()
33 assertFalse(ai.isMarked()); in testConstructor()
44 AtomicMarkableReference ai = new AtomicMarkableReference(one, false); in testGetSet() local
45 assertSame(one, ai.getReference()); in testGetSet()
46 assertFalse(ai.isMarked()); in testGetSet()
47 assertSame(one, ai.get(mark)); in testGetSet()
49 ai.set(two, false); in testGetSet()
50 assertSame(two, ai.getReference()); in testGetSet()
51 assertFalse(ai.isMarked()); in testGetSet()
[all …]
DAtomicStampedReferenceTest.java31 AtomicStampedReference ai = new AtomicStampedReference(one, 0); in testConstructor() local
32 assertSame(one, ai.getReference()); in testConstructor()
33 assertEquals(0, ai.getStamp()); in testConstructor()
44 AtomicStampedReference ai = new AtomicStampedReference(one, 0); in testGetSet() local
45 assertSame(one, ai.getReference()); in testGetSet()
46 assertEquals(0, ai.getStamp()); in testGetSet()
47 assertSame(one, ai.get(mark)); in testGetSet()
49 ai.set(two, 0); in testGetSet()
50 assertSame(two, ai.getReference()); in testGetSet()
51 assertEquals(0, ai.getStamp()); in testGetSet()
[all …]
DAtomicReferenceTest.java31 AtomicReference ai = new AtomicReference(one); in testConstructor() local
32 assertSame(one, ai.get()); in testConstructor()
39 AtomicReference ai = new AtomicReference(); in testConstructor2() local
40 assertNull(ai.get()); in testConstructor2()
47 AtomicReference ai = new AtomicReference(one); in testGetSet() local
48 assertSame(one, ai.get()); in testGetSet()
49 ai.set(two); in testGetSet()
50 assertSame(two, ai.get()); in testGetSet()
51 ai.set(m3); in testGetSet()
52 assertSame(m3, ai.get()); in testGetSet()
[all …]
DDoubleAccumulatorTest.java32 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testConstructor() local
33 assertEquals(0.0, ai.get()); in testConstructor()
40 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGet() local
41 ai.accumulate(2.0); in testAccumulateAndGet()
42 assertEquals(2.0, ai.get()); in testAccumulateAndGet()
43 ai.accumulate(-4.0); in testAccumulateAndGet()
44 assertEquals(2.0, ai.get()); in testAccumulateAndGet()
45 ai.accumulate(4.0); in testAccumulateAndGet()
46 assertEquals(4.0, ai.get()); in testAccumulateAndGet()
53 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testReset() local
[all …]
DLongAccumulatorTest.java32 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testConstructor() local
33 assertEquals(0, ai.get()); in testConstructor()
40 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testAccumulateAndGet() local
41 ai.accumulate(2); in testAccumulateAndGet()
42 assertEquals(2, ai.get()); in testAccumulateAndGet()
43 ai.accumulate(-4); in testAccumulateAndGet()
44 assertEquals(2, ai.get()); in testAccumulateAndGet()
45 ai.accumulate(4); in testAccumulateAndGet()
46 assertEquals(4, ai.get()); in testAccumulateAndGet()
53 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testReset() local
[all …]
DDoubleAdderTest.java32 DoubleAdder ai = new DoubleAdder(); in testConstructor() local
33 assertEquals(0.0, ai.sum()); in testConstructor()
40 DoubleAdder ai = new DoubleAdder(); in testAddAndSum() local
41 ai.add(2.0); in testAddAndSum()
42 assertEquals(2.0, ai.sum()); in testAddAndSum()
43 ai.add(-4.0); in testAddAndSum()
44 assertEquals(-2.0, ai.sum()); in testAddAndSum()
51 DoubleAdder ai = new DoubleAdder(); in testReset() local
52 ai.add(2.0); in testReset()
53 assertEquals(2.0, ai.sum()); in testReset()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DAtomicIntegerTest.java58 AtomicInteger ai = new AtomicInteger(1); in testConstructor() local
59 assertEquals(1, ai.get()); in testConstructor()
66 AtomicInteger ai = new AtomicInteger(); in testConstructor2() local
67 assertEquals(0, ai.get()); in testConstructor2()
74 AtomicInteger ai = new AtomicInteger(1); in testGetSet() local
75 assertEquals(1, ai.get()); in testGetSet()
76 ai.set(2); in testGetSet()
77 assertEquals(2, ai.get()); in testGetSet()
78 ai.set(-3); in testGetSet()
79 assertEquals(-3, ai.get()); in testGetSet()
[all …]
DAtomicLongTest.java60 AtomicLong ai = new AtomicLong(1); in testConstructor() local
61 assertEquals(1, ai.get()); in testConstructor()
68 AtomicLong ai = new AtomicLong(); in testConstructor2() local
69 assertEquals(0, ai.get()); in testConstructor2()
76 AtomicLong ai = new AtomicLong(1); in testGetSet() local
77 assertEquals(1, ai.get()); in testGetSet()
78 ai.set(2); in testGetSet()
79 assertEquals(2, ai.get()); in testGetSet()
80 ai.set(-3); in testGetSet()
81 assertEquals(-3, ai.get()); in testGetSet()
[all …]
DAtomicBooleanTest.java62 AtomicBoolean ai = new AtomicBoolean(); in testConstructor2() local
63 assertFalse(ai.get()); in testConstructor2()
70 AtomicBoolean ai = new AtomicBoolean(true); in testGetSet() local
71 assertTrue(ai.get()); in testGetSet()
72 ai.set(false); in testGetSet()
73 assertFalse(ai.get()); in testGetSet()
74 ai.set(true); in testGetSet()
75 assertTrue(ai.get()); in testGetSet()
82 AtomicBoolean ai = new AtomicBoolean(true); in testGetLazySet() local
83 assertTrue(ai.get()); in testGetLazySet()
[all …]
DLongAdderTest.java55 LongAdder ai = new LongAdder(); in testConstructor() local
56 assertEquals(0, ai.sum()); in testConstructor()
63 LongAdder ai = new LongAdder(); in testAddAndSum() local
64 ai.add(2); in testAddAndSum()
65 assertEquals(2, ai.sum()); in testAddAndSum()
66 ai.add(-4); in testAddAndSum()
67 assertEquals(-2, ai.sum()); in testAddAndSum()
74 LongAdder ai = new LongAdder(); in testDecrementAndsum() local
75 ai.decrement(); in testDecrementAndsum()
76 assertEquals(-1, ai.sum()); in testDecrementAndsum()
[all …]
DAtomicMarkableReferenceTest.java54 AtomicMarkableReference ai = new AtomicMarkableReference(one, false); in testConstructor() local
55 assertSame(one, ai.getReference()); in testConstructor()
56 assertFalse(ai.isMarked()); in testConstructor()
67 AtomicMarkableReference ai = new AtomicMarkableReference(one, false); in testGetSet() local
68 assertSame(one, ai.getReference()); in testGetSet()
69 assertFalse(ai.isMarked()); in testGetSet()
70 assertSame(one, ai.get(mark)); in testGetSet()
72 ai.set(two, false); in testGetSet()
73 assertSame(two, ai.getReference()); in testGetSet()
74 assertFalse(ai.isMarked()); in testGetSet()
[all …]
DAtomicStampedReferenceTest.java54 AtomicStampedReference ai = new AtomicStampedReference(one, 0); in testConstructor() local
55 assertSame(one, ai.getReference()); in testConstructor()
56 assertEquals(0, ai.getStamp()); in testConstructor()
67 AtomicStampedReference ai = new AtomicStampedReference(one, 0); in testGetSet() local
68 assertSame(one, ai.getReference()); in testGetSet()
69 assertEquals(0, ai.getStamp()); in testGetSet()
70 assertSame(one, ai.get(mark)); in testGetSet()
72 ai.set(two, 0); in testGetSet()
73 assertSame(two, ai.getReference()); in testGetSet()
74 assertEquals(0, ai.getStamp()); in testGetSet()
[all …]
DAtomicReferenceTest.java54 AtomicReference ai = new AtomicReference(one); in testConstructor() local
55 assertSame(one, ai.get()); in testConstructor()
62 AtomicReference ai = new AtomicReference(); in testConstructor2() local
63 assertNull(ai.get()); in testConstructor2()
70 AtomicReference ai = new AtomicReference(one); in testGetSet() local
71 assertSame(one, ai.get()); in testGetSet()
72 ai.set(two); in testGetSet()
73 assertSame(two, ai.get()); in testGetSet()
74 ai.set(m3); in testGetSet()
75 assertSame(m3, ai.get()); in testGetSet()
[all …]
DLongAccumulatorTest.java55 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testConstructor() local
56 assertEquals(0, ai.get()); in testConstructor()
63 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testAccumulateAndGet() local
64 ai.accumulate(2); in testAccumulateAndGet()
65 assertEquals(2, ai.get()); in testAccumulateAndGet()
66 ai.accumulate(-4); in testAccumulateAndGet()
67 assertEquals(2, ai.get()); in testAccumulateAndGet()
68 ai.accumulate(4); in testAccumulateAndGet()
69 assertEquals(4, ai.get()); in testAccumulateAndGet()
76 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testReset() local
[all …]
DDoubleAccumulatorTest.java55 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testConstructor() local
56 assertEquals(0.0, ai.get()); in testConstructor()
63 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGet() local
64 ai.accumulate(2.0); in testAccumulateAndGet()
65 assertEquals(2.0, ai.get()); in testAccumulateAndGet()
66 ai.accumulate(-4.0); in testAccumulateAndGet()
67 assertEquals(2.0, ai.get()); in testAccumulateAndGet()
68 ai.accumulate(4.0); in testAccumulateAndGet()
69 assertEquals(4.0, ai.get()); in testAccumulateAndGet()
76 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testReset() local
[all …]
DDoubleAdderTest.java55 DoubleAdder ai = new DoubleAdder(); in testConstructor() local
56 assertEquals(0.0, ai.sum()); in testConstructor()
63 DoubleAdder ai = new DoubleAdder(); in testAddAndSum() local
64 ai.add(2.0); in testAddAndSum()
65 assertEquals(2.0, ai.sum()); in testAddAndSum()
66 ai.add(-4.0); in testAddAndSum()
67 assertEquals(-2.0, ai.sum()); in testAddAndSum()
74 DoubleAdder ai = new DoubleAdder(); in testReset() local
75 ai.add(2.0); in testReset()
76 assertEquals(2.0, ai.sum()); in testReset()
[all …]
DCountedCompleter8Test.java153 AtomicInteger ai = new AtomicInteger(0); in testRecursiveDecomposition() local
154 action.accept(a, ai::addAndGet); in testRecursiveDecomposition()
155 assertEquals(n * (n + 1) / 2, ai.get()); in testRecursiveDecomposition()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/xml/sax/helpers/
DAttributeListImplTest.java45 AttributeListImpl ai = new AttributeListImpl(empty); in testAttributeListImplAttributeList() local
46 assertEquals(0, ai.getLength()); in testAttributeListImplAttributeList()
49 ai = new AttributeListImpl(multi); in testAttributeListImplAttributeList()
50 assertEquals(3, ai.getLength()); in testAttributeListImplAttributeList()
54 ai = new AttributeListImpl(null); in testAttributeListImplAttributeList()
55 assertEquals(0, ai.getLength()); in testAttributeListImplAttributeList()
134 AttributeListImpl ai = new AttributeListImpl(empty); in testGetLength() local
135 assertEquals(0, ai.getLength()); in testGetLength()
137 ai = new AttributeListImpl(multi); in testGetLength()
138 assertEquals(3, ai.getLength()); in testGetLength()
[all …]
DAttributesImplTest.java50 AttributesImpl ai = new AttributesImpl(empty); in testAttributesImplAttributes() local
51 assertEquals(0, ai.getLength()); in testAttributesImplAttributes()
54 ai = new AttributesImpl(multi); in testAttributesImplAttributes()
55 assertEquals(5, ai.getLength()); in testAttributesImplAttributes()
59 ai = new AttributesImpl(null); in testAttributesImplAttributes()
60 assertEquals(0, ai.getLength()); in testAttributesImplAttributes()
68 AttributesImpl ai = new AttributesImpl(empty); in testGetLength() local
69 assertEquals(0, ai.getLength()); in testGetLength()
71 ai = new AttributesImpl(multi); in testGetLength()
72 assertEquals(5, ai.getLength()); in testGetLength()
[all …]
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DCountedCompleterTest.java46 AtomicInteger ai = new AtomicInteger(0); in chooseOne() field in CountedCompleterTest.Task
76 return new Integer(ai.intValue()); in chooseOne()
80 ai.addAndGet(val.intValue()); in chooseOne()
190 AtomicInteger ai = new AtomicInteger(0); in testHelpComplete() local
194 completeAllChildren(a, ai::addAndGet); in testHelpComplete()
195 assertEquals(n * (n + 1) / 2, ai.get()); in testHelpComplete()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DLongPrimitiveOpsTests.java72 AtomicLong ai = new AtomicLong(0); in testParForEach() local
73 LongStream.range(1, 10).parallel().filter(i -> i % 2 == 0).forEach(ai::addAndGet); in testParForEach()
74 assertEquals(ai.get(), 20); in testParForEach()

12