Home
last modified time | relevance | path

Searched refs:val (Results 1 – 25 of 233) sorted by relevance

12345678910

/libcore/luni/src/test/java/libcore/java/util/concurrent/
DAtomicLongTest.java32 AtomicLong val = new AtomicLong(42); in testCompareAndExchange() local
33 assertEquals(42, val.compareAndExchange(0, 1)); in testCompareAndExchange()
34 assertEquals(42, val.get()); in testCompareAndExchange()
35 assertEquals(42, val.compareAndExchange(42, 1)); in testCompareAndExchange()
36 assertEquals(1, val.get()); in testCompareAndExchange()
37 assertEquals(1, val.compareAndExchange(1, -1)); in testCompareAndExchange()
38 assertEquals(-1, val.get()); in testCompareAndExchange()
39 assertEquals(-1, val.compareAndExchange(42, 0)); in testCompareAndExchange()
40 assertEquals(-1, val.get()); in testCompareAndExchange()
45 AtomicLong val = new AtomicLong(42); in testCompareAndExchangeAcquire() local
[all …]
DAtomicIntegerTest.java32 AtomicInteger val = new AtomicInteger(42); in testCompareAndExchange() local
33 assertEquals(42, val.compareAndExchange(0, 1)); in testCompareAndExchange()
34 assertEquals(42, val.get()); in testCompareAndExchange()
35 assertEquals(42, val.compareAndExchange(42, 1)); in testCompareAndExchange()
36 assertEquals(1, val.get()); in testCompareAndExchange()
37 assertEquals(1, val.compareAndExchange(1, -1)); in testCompareAndExchange()
38 assertEquals(-1, val.get()); in testCompareAndExchange()
39 assertEquals(-1, val.compareAndExchange(42, 0)); in testCompareAndExchange()
40 assertEquals(-1, val.get()); in testCompareAndExchange()
45 AtomicInteger val = new AtomicInteger(42); in testCompareAndExchangeAcquire() local
[all …]
DAtomicBooleanTest.java32 AtomicBoolean val = new AtomicBoolean(true); in testCompareAndExchange() local
35 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
36 assertEquals(true, val.get()); in testCompareAndExchange()
37 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
38 assertEquals(true, val.get()); in testCompareAndExchange()
40 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
41 assertEquals(false, val.get()); in testCompareAndExchange()
42 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
43 assertEquals(false, val.get()); in testCompareAndExchange()
46 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
[all …]
DAtomicReferenceTest.java34 AtomicReference<Integer> val = new AtomicReference(currentValue); in testCompareAndExchange() local
38 Integer result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
41 assertSame(currentValue, val.get()); in testCompareAndExchange()
45 result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
48 assertSame(currentValue, val.get()); in testCompareAndExchange()
51 result = val.compareAndExchange(currentValue, newValue); in testCompareAndExchange()
54 assertSame(newValue, val.get()); in testCompareAndExchange()
55 currentValue = val.get(); in testCompareAndExchange()
61 result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
64 assertSame(currentValue, val.get()); in testCompareAndExchange()
[all …]
DAtomicReferenceArrayTest.java48 Integer val = Integer.valueOf(i+1); in testCompareAndExchange() local
49 assertEquals(expectedArray[i], arr.compareAndExchange(i, Integer.valueOf(0), val)); in testCompareAndExchange()
52 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], val)); in testCompareAndExchange()
53 assertSame(val, arr.get(i)); in testCompareAndExchange()
55 expectedArray[i] = val; in testCompareAndExchange()
58 val = Integer.valueOf(-1); in testCompareAndExchange()
59 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], val)); in testCompareAndExchange()
60 assertSame(val, arr.get(i)); in testCompareAndExchange()
62 expectedArray[i] = val; in testCompareAndExchange()
65 val = Integer.valueOf(i*2); in testCompareAndExchange()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDateFormatSymbolsTest.java120 String[] val = { "AM", "PM" }; in test_getAmPmStrings() local
121 if (retVal.length != val.length) in test_getAmPmStrings()
123 for (int i = 0; i < val.length; i++) in test_getAmPmStrings()
124 assertTrue("Array values do not match", retVal[i].equals(val[i])); in test_getAmPmStrings()
134 String[] val = { "BC", "AD" }; in test_getEras() local
135 if (retVal.length != val.length) in test_getEras()
137 for (int i = 0; i < val.length; i++) in test_getEras()
138 assertTrue("Array values do not match", retVal[i].equals(val[i])); in test_getEras()
148 String[] val = { "January", "February", "March", "April", "May", in test_getMonths() local
151 assertEquals("Returned wrong array: ", val.length, retVal.length); in test_getMonths()
[all …]
/libcore/ojluni/src/main/java/java/io/
DBits.java84 static void putBoolean(byte[] b, int off, boolean val) { in putBoolean() argument
85 b[off] = (byte) (val ? 1 : 0); in putBoolean()
88 static void putChar(byte[] b, int off, char val) { in putChar() argument
89 b[off + 1] = (byte) (val ); in putChar()
90 b[off ] = (byte) (val >>> 8); in putChar()
93 static void putShort(byte[] b, int off, short val) { in putShort() argument
94 b[off + 1] = (byte) (val ); in putShort()
95 b[off ] = (byte) (val >>> 8); in putShort()
98 static void putInt(byte[] b, int off, int val) { in putInt() argument
99 b[off + 3] = (byte) (val ); in putInt()
[all …]
DExpiringCache.java46 private String val; field in ExpiringCache.Entry
48 Entry(long timestamp, String val) { in Entry() argument
50 this.val = val; in Entry()
56 String val() { return val; } in val() method in ExpiringCache.Entry
57 void setVal(String val) { this.val = val; } in setVal() argument
85 return entry.val(); in get()
90 synchronized void put(String key, String val) { in put() argument
97 entry.setVal(val); in put()
99 map.put(key, new Entry(System.currentTimeMillis(), val)); in put()
/libcore/luni/src/test/java/libcore/java/util/
DOldAndroidTreeMapTest.java49 int val = mRandom.nextInt(1000); in doTest() local
50 if (SPEW) System.out.println("Adding val = " + val); in doTest()
51 if (val < minVal) { in doTest()
52 minVal = val; in doTest()
54 if (val > maxVal) { in doTest()
55 maxVal = val; in doTest()
57 tm.put(Integer.valueOf(val), "V:" + val); in doTest() local
58 hm.put(Integer.valueOf(val), "V:" + val); in doTest() local
75 for (int val = 0; val < 1000; val++) { in doTest()
76 Integer vv = Integer.valueOf(val); in doTest()
[all …]
/libcore/ojluni/src/test/java/lang/Long/
DParsingTest.java116 private static void check(long expected, String val) { in check() argument
117 long n = Long.parseLong(val); in check()
120 val + " Result:" + n); in check()
123 private static void checkFailure(String val) { in checkFailure() argument
126 n = Long.parseLong(val); in checkFailure()
127 System.err.println("parseLong(" + val + ") incorrectly returned " + n); in checkFailure()
134 private static void checkNumberFormatException(String val, int start, int end, int radix) { in checkNumberFormatException() argument
139 n = Long_parseLong(val, start, end, radix); in checkNumberFormatException()
140 System.err.println("parseLong(" + val + ", " + start + ", " + end + ", " + radix + in checkNumberFormatException()
148 private static void checkIndexOutOfBoundsException(String val, int start, int end, int radix) { in checkIndexOutOfBoundsException() argument
[all …]
/libcore/ojluni/src/main/java/sun/security/x509/
DX509CertInfo.java364 public void set(String name, Object val) in set() argument
380 setVersion(val); in set()
382 version.set(suffix, val); in set()
388 setSerialNumber(val); in set()
390 serialNum.set(suffix, val); in set()
396 setAlgorithmId(val); in set()
398 algId.set(suffix, val); in set()
403 setIssuer(val); in set()
408 setValidity(val); in set()
410 interval.set(suffix, val); in set()
[all …]
/libcore/ojluni/src/test/java/lang/Integer/
DParsingTest.java124 private static void check(int expected, String val) { in check() argument
125 int n = Integer.parseInt(val); in check()
128 val + " Result:" + n); in check()
131 private static void checkFailure(String val) { in checkFailure() argument
134 n = Integer.parseInt(val); in checkFailure()
135 System.err.println("parseInt(" + val + ") incorrectly returned " + n); in checkFailure()
142 private static void checkNumberFormatException(String val, int start, int end, int radix) { in checkNumberFormatException() argument
147 n = Integer_parseInt(val, start, end, radix); in checkNumberFormatException()
148 System.err.println("parseInt(" + val + ", " + start + ", " + end + ", " + radix + in checkNumberFormatException()
156 private static void checkIndexOutOfBoundsException(String val, int start, int end, int radix) { in checkIndexOutOfBoundsException() argument
[all …]
/libcore/luni/src/test/java/libcore/android/system/
DStructTimespecTest.java28 StructTimespec val = new StructTimespec(Long.MIN_VALUE, 0); in testConstructor() local
29 assertEquals(Long.MIN_VALUE, val.tv_sec); in testConstructor()
30 assertEquals(0, val.tv_nsec); in testConstructor()
32 val = new StructTimespec(-23, 23); in testConstructor()
33 assertEquals(-23, val.tv_sec); in testConstructor()
34 assertEquals(23, val.tv_nsec); in testConstructor()
36 val = new StructTimespec(0, 42); in testConstructor()
37 assertEquals(0, val.tv_sec); in testConstructor()
38 assertEquals(42, val.tv_nsec); in testConstructor()
40 val = new StructTimespec(23, 91); in testConstructor()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DLongTest.java215 for(long val : vals) {
217 assertEquals(val, Long.parseUnsignedLong(Long.toBinaryString(val), 2));
218 assertEquals(val, Long.parseUnsignedLong(Long.toOctalString(val), 8));
219 assertEquals(val, Long.parseUnsignedLong(Long.toUnsignedString(val)));
220 assertEquals(val, Long.parseUnsignedLong(Long.toHexString(val), 16));
223 assertEquals(val,
224 Long.parseUnsignedLong(Long.toUnsignedString(val, radix), radix));
254 for(long val : vals) {
256 assertTrue(Long.toUnsignedString(val, 2).equals(Long.toBinaryString(val)));
257 assertTrue(Long.toUnsignedString(val, 8).equals(Long.toOctalString(val)));
[all …]
/libcore/ojluni/src/main/java/java/math/
DBigInteger.java309 public BigInteger(byte[] val, int off, int len) { in BigInteger() argument
310 if (val.length == 0) { in BigInteger()
313 Objects.checkFromIndexSize(off, len, val.length); in BigInteger()
315 if (val[off] < 0) { in BigInteger()
316 mag = makePositive(val, off, len); in BigInteger()
319 mag = stripLeadingZeroBytes(val, off, len); in BigInteger()
338 public BigInteger(byte[] val) { in BigInteger() argument
339 this(val, 0, val.length); in BigInteger()
350 private BigInteger(int[] val) { in BigInteger() argument
351 if (val.length == 0) in BigInteger()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/serial/
DTCKWeekFieldsSerialization.java111 byte[] val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
112 System.arraycopy(good1, 0, val, 105, good1.length); in test_invalid_serialform()
113 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
122 val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
123 System.arraycopy(bad1, 0, val, 105, bad1.length); in test_invalid_serialform()
124 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
133 val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
134 System.arraycopy(bad2, 0, val, 105, bad2.length); in test_invalid_serialform()
135 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
144 val = Arrays.copyOf(template, 110); in test_invalid_serialform()
[all …]
DTCKValueRangeSerialization.java146 byte[] val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
147 System.arraycopy(bad1, 0, val, 114, bad1.length); in test_invalid_serialform()
148 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
157 val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
158 System.arraycopy(bad1, 0, val, 114, bad2.length); in test_invalid_serialform()
159 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
168 val = Arrays.copyOf(template, template.length); in test_invalid_serialform()
169 System.arraycopy(bad1, 0, val, 114, bad3.length); in test_invalid_serialform()
170 try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { in test_invalid_serialform()
/libcore/ojluni/annotations/sdk/nullability/java/math/
DBigInteger.annotated.java31 public BigInteger(byte[] val, int off, int len) { throw new RuntimeException("Stub!"); } in BigInteger() argument
33 public BigInteger(byte[] val) { throw new RuntimeException("Stub!"); } in BigInteger() argument
39 …public BigInteger(@libcore.util.NonNull java.lang.String val, int radix) { throw new RuntimeExcept… in BigInteger() argument
41 …public BigInteger(@libcore.util.NonNull java.lang.String val) { throw new RuntimeException("Stub!"… in BigInteger() argument
53 …@libcore.util.NonNull public static BigInteger valueOf(long val) { throw new RuntimeException("Stu… in valueOf() argument
63 …@libcore.util.NonNull public BigInteger add(@libcore.util.NonNull BigInteger val) { throw new Runt… in add() argument
65 …@libcore.util.NonNull public BigInteger subtract(@libcore.util.NonNull BigInteger val) { throw new… in subtract() argument
67 …@libcore.util.NonNull public BigInteger multiply(@libcore.util.NonNull BigInteger val) { throw new… in multiply() argument
69 …@libcore.util.NonNull public BigInteger divide(@libcore.util.NonNull BigInteger val) { throw new R… in divide() argument
71 …ll public BigInteger[] divideAndRemainder(@libcore.util.NonNull BigInteger val) { throw new Runtim… in divideAndRemainder() argument
[all …]
/libcore/ojluni/src/test/java/util/Collections/
DReverseOrder.java88 int val; field in Foo
89 Foo(int i) { val = i; } in Foo()
93 return (val < f.val ? Integer.MIN_VALUE : (val == f.val ? 0 : 1)); in compareTo()
97 return o instanceof Foo && ((Foo)o).val == val; in equals()
100 public int hashCode() { return val; } in hashCode()
102 public String toString() { return Integer.toString(val); } in toString()
/libcore/ojluni/src/test/java/util/Map/
DInPlaceOpsCollisions.java49 public void testPutIfAbsent(String desc, Supplier<Map<Object, Object>> ms, Object val) { in testPutIfAbsent() argument
55 retVal = map.putIfAbsent(keys[i], val); in testPutIfAbsent()
67 assertEquals(val, map.get(keys[i]), in testPutIfAbsent()
80 public void testRemoveMapping(String desc, Supplier<Map<Object, Object>> ms, Object val) { in testRemoveMapping() argument
85 remapOddKeys(map, keys, val); in testRemoveMapping()
101 assertEquals(val, map.get(keys[i]), in testRemoveMapping()
105 assertTrue(map.containsValue(val), in testRemoveMapping()
114 public void testReplaceOldValue(String desc, Supplier<Map<Object, Object>> ms, Object val) { in testReplaceOldValue() argument
121 remapOddKeys(map, keys, val); in testReplaceOldValue()
124 replaced = map.replace(keys[i], val, keys[i]); in testReplaceOldValue()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/
DFieldTest.java188 Double val = (Double) f.get(x); in test_getLjava_lang_Object() local
191 val.doubleValue() == Double.MAX_VALUE); in test_getLjava_lang_Object()
195 val = (Double) f.get(x); in test_getLjava_lang_Object()
196 assertEquals("Returned incorrect double field value", 1.0, val.doubleValue()); in test_getLjava_lang_Object()
560 boolean val = false; in test_getBooleanLjava_lang_Object()
563 val = f.getBoolean(x); in test_getBooleanLjava_lang_Object()
567 assertTrue("Returned incorrect boolean field value", val); in test_getBooleanLjava_lang_Object()
614 byte val = 0; in test_getByteLjava_lang_Object()
617 val = f.getByte(x); in test_getByteLjava_lang_Object()
621 assertTrue("Returned incorrect byte field value", val == Byte.MAX_VALUE); in test_getByteLjava_lang_Object()
[all …]
/libcore/ojluni/src/main/java/sun/net/
DNetProperties.java112 String val = null; in getInteger() local
115 val = System.getProperty(key, props.getProperty(key)); in getInteger()
120 if (val != null) { in getInteger()
122 return Integer.decode(val); in getInteger()
141 String val = null; in getBoolean() local
144 val = System.getProperty(key, props.getProperty(key)); in getBoolean()
149 if (val != null) { in getBoolean()
151 return Boolean.valueOf(val); in getBoolean()
/libcore/ojluni/src/test/java/lang/Float/
DParseFloatTest.java41 private static void fail(String val, float n) { in fail() argument
42 Assert.fail("Float.parseFloat failed. String:" + val + " Result:" + n); in fail()
45 private static void check(String val) { in check() argument
46 float n = Float.parseFloat(val); in check()
49 String s = val.trim().toLowerCase(); in check()
65 fail(val, n); in check()
70 fail(val, n); in check()
73 fail(val, n); in check()
76 fail(val, n); in check()
114 fail(val, n); in check()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DSecurityProperties.java55 String val = System.getProperty(propName); in getOverridableProperty() local
56 if (val == null) { in getOverridableProperty()
59 return val; in getOverridableProperty()
72 String val = privilegedGetOverridable("jdk.includeInExceptions"); in includedInExceptions() local
73 if (val == null) { in includedInExceptions()
77 String[] tokens = val.split(","); in includedInExceptions()
/libcore/ojluni/src/main/java/java/lang/
DStringUTF16.java55 static void putChar(byte[] val, int index, int c) { in putChar() argument
56 assert index >= 0 && index < length(val) : "Trusted caller missed bounds check"; in putChar()
58 val[index++] = (byte)(c >> HI_BYTE_SHIFT); in putChar()
59 val[index] = (byte)(c >> LO_BYTE_SHIFT); in putChar()
64 public static char getChar(byte[] val, int index) { in getChar() argument
65 assert index >= 0 && index < length(val) : "Trusted caller missed bounds check"; in getChar()
67 return (char)(((val[index++] & 0xff) << HI_BYTE_SHIFT) | in getChar()
68 ((val[index] & 0xff) << LO_BYTE_SHIFT)); in getChar()
82 static char getChar(String val, int index) {
83 return val.charAt(index);
[all …]

12345678910