/libcore/luni/src/test/java/libcore/java/util/ |
D | CalendarBuilderTest.java | 38 GregorianCalendar expected = new GregorianCalendar(); in test_default_values() local 39 expected.clear(); in test_default_values() 40 assertEquals(expected, builder.build()); in test_default_values() 48 GregorianCalendar expected = new GregorianCalendar(); in test_setCalendarType_iso8601() local 49 expected.clear(); in test_setCalendarType_iso8601() 50 expected.setGregorianChange(new Date(Long.MIN_VALUE)); in test_setCalendarType_iso8601() 51 expected.setFirstDayOfWeek(Calendar.MONDAY); in test_setCalendarType_iso8601() 52 expected.setMinimalDaysInFirstWeek(4); in test_setCalendarType_iso8601() 53 assertEquals(expected, builder.build()); in test_setCalendarType_iso8601() 62 } catch (NullPointerException expected) {} in test_setCalendarType_invalid() [all …]
|
/libcore/ojluni/src/test/java/lang/Math/ |
D | Tests.java | 238 boolean result, boolean expected) { in test() argument 239 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 241 "\texpected " + expected + "\n" + in test() 246 boolean result, boolean expected) { in test() argument 247 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 249 "\texpected " + expected + "\n" + in test() 254 boolean result, boolean expected) { in test() argument 255 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 258 "\texpected " + expected + "\n" + in test() 263 boolean result, boolean expected) { in test() argument [all …]
|
D | WorstCaseTests.java | 103 private static void testExpCase(double input, double expected) { in testExpCase() argument 104 double out = Tests.nextOut(expected); in testExpCase() 105 Tests.testBounds("Math.exp", input, Math.exp(input), expected, out); in testExpCase() 106 Tests.testBounds("StrictMath.exp", input, StrictMath.exp(input), expected, out); in testExpCase() 131 private static void testLogCase(double input, double expected) { in testLogCase() argument 132 double out = Tests.nextOut(expected); in testLogCase() 133 Tests.testBounds("Math.log", input, Math.log(input), expected, out); in testLogCase() 134 Tests.testBounds("StrictMath.log", input, StrictMath.log(input), expected, out); in testLogCase() 160 private static void testSinCase(double input, double expected) { in testSinCase() argument 161 double out = Tests.nextOut(expected); in testSinCase() [all …]
|
D | PowTests.java | 42 static void testPowCase(double input1, double input2, double expected) { in testPowCase() argument 44 StrictMath.pow(input1, input2), expected); in testPowCase() 53 double strictMathExpected = expected; in testPowCase() 65 static void testStrictPowCase(double input1, double input2, double expected) { in testStrictPowCase() argument 67 StrictMath.pow(input1, input2), expected); in testStrictPowCase() 70 static void testNonstrictPowCase(double input1, double input2, double expected) { in testNonstrictPowCase() argument 72 Math.pow(input1, input2), expected); in testNonstrictPowCase() 168 double expected = NaN; in testCrossProduct() local 173 expected = NaN; in testCrossProduct() 175 expected = 1.0; in testCrossProduct() [all …]
|
D | HyperbolicTests.java | 336 double expected = in testSinh() local 340 testSinhCaseWithUlpDiff(input, expected, 4.0); in testSinh() 354 double expected, in testSinhCaseWithTolerance() argument 359 expected, tolerance); in testSinhCaseWithTolerance() 362 -expected, tolerance); in testSinhCaseWithTolerance() 366 expected, tolerance); in testSinhCaseWithTolerance() 369 -expected, tolerance); in testSinhCaseWithTolerance() 374 double expected, in testSinhCaseWithUlpDiff() argument 379 expected, ulps); in testSinhCaseWithUlpDiff() 382 -expected, ulps); in testSinhCaseWithUlpDiff() [all …]
|
D | Log10Tests.java | 47 static void testLog10Case(double input, double expected) { in testLog10Case() argument 49 Math.log10(input), expected); in testLog10Case() 52 StrictMath.log10(input), expected); in testLog10Case() 103 double expected = StrictMath.log(input) / LN_10; in testLog10() local 104 if (!Double.isFinite(expected)) { in testLog10() 109 if (Math.abs(((result = Math.log10(input)) - expected) / Math.ulp(expected)) in testLog10() 114 "\tlog(input)/log(10) = " + expected); in testLog10() 118 ((result = StrictMath.log10(input)) - expected) / Math.ulp(expected)) in testLog10() 123 "\tlog(input)/log(10) = " + expected); in testLog10() 170 double expected = (z - (z * z) * 0.5) / LN_10; in testLog10() local [all …]
|
/libcore/luni/src/test/java/libcore/java/util/concurrent/ |
D | AtomicBooleanTest.java | 33 boolean expected = false; in testCompareAndExchange() 35 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange() 37 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange() 39 expected = true; in testCompareAndExchange() 40 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange() 42 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange() 44 expected = false; in testCompareAndExchange() 46 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange() 53 boolean expected = false; in testCompareAndExchangeAcquire() 55 assertEquals(true, val.compareAndExchangeAcquire(expected, newValue)); in testCompareAndExchangeAcquire() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/reflect/ |
D | ArrayTest.java | 46 try { Array.getBoolean(bytes, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 47 try { Array.getBoolean(chars, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 48 try { Array.getBoolean(doubles, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 49 try { Array.getBoolean(floats, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 50 try { Array.getBoolean(ints, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 51 try { Array.getBoolean(longs, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 52 try { Array.getBoolean(shorts, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean() 53 try { Array.getBoolean(null, 0); fail(); } catch (NullPointerException expected) {} in testGetBoolean() 57 try { Array.getByte(booleans, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetByte() 59 try { Array.getByte(chars, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetByte() [all …]
|
/libcore/dom/src/test/java/org/w3c/domts/ |
D | DOMTestInnerClass.java | 53 public void assertSame(String assertID, Object expected, Object actual) { in assertSame() argument 54 test.assertSame(assertID, expected, actual); in assertSame() 75 public void assertEqualsIgnoreCase(String assertID, String expected, in assertEqualsIgnoreCase() argument 77 test.assertEqualsIgnoreCase(assertID, expected, actual); in assertEqualsIgnoreCase() 80 public void assertEqualsIgnoreCase(String assertID, Collection expected, in assertEqualsIgnoreCase() argument 82 test.assertEqualsIgnoreCase(assertID, expected, actual); in assertEqualsIgnoreCase() 85 public void assertEqualsIgnoreCase(String assertID, List expected, in assertEqualsIgnoreCase() argument 87 test.assertEqualsIgnoreCase(assertID, expected, actual); in assertEqualsIgnoreCase() 90 public void assertEquals(String assertID, String expected, String actual) { in assertEquals() argument 91 test.assertEquals(assertID, expected, actual); in assertEquals() [all …]
|
D | DOMTestCase.java | 213 public void assertSame(String assertID, Object expected, Object actual) { in assertSame() argument 214 framework.assertSame(this, assertID, expected, actual); in assertSame() 294 String expected, in assertEqualsIgnoreCase() argument 296 framework.assertEqualsIgnoreCase(this, assertID, expected, actual); in assertEqualsIgnoreCase() 312 Collection expected, in assertEqualsIgnoreCase() argument 314 framework.assertEqualsIgnoreCase(this, assertID, expected, actual); in assertEqualsIgnoreCase() 330 List expected, in assertEqualsIgnoreCase() argument 332 framework.assertEqualsIgnoreCase(this, assertID, expected, actual); in assertEqualsIgnoreCase() 348 String expected, in assertEqualsAutoCase() argument 359 framework.assertEqualsIgnoreCase(this, assertID, expected, actual); in assertEqualsAutoCase() [all …]
|
D | JUnitTestCaseAdapter.java | 202 public void assertSame(DOMTestCase test, String assertID, Object expected, Object actual) { in assertSame() argument 203 boolean same = (expected == actual); in assertSame() 209 if(expected == null || actual == null || in assertSame() 210 !(expected instanceof Node) || !(actual instanceof Node)) { in assertSame() 211 assertEquals(assertID,expected,actual); in assertSame() 217 assertEquals(assertID,expected,actual); in assertSame() 238 …public void assertEqualsIgnoreCase(DOMTestCase test, String assertID, String expected, String actu… in assertEqualsIgnoreCase() argument 239 if (!expected.equalsIgnoreCase(actual)) { in assertEqualsIgnoreCase() 240 assertEquals(assertID,expected, actual); in assertEqualsIgnoreCase() 244 …public void assertEqualsIgnoreCase(DOMTestCase test, String assertID, Collection expected, Collect… in assertEqualsIgnoreCase() argument [all …]
|
D | DOMTestFramework.java | 47 Object expected, in assertSame() argument 77 String expected, in assertEqualsIgnoreCase() argument 83 Collection expected, in assertEqualsIgnoreCase() argument 89 List expected, in assertEqualsIgnoreCase() argument 95 String expected, in assertEquals() argument 101 int expected, in assertEquals() argument 107 boolean expected, in assertEquals() argument 113 double expected, in assertEquals() argument 119 Collection expected, in assertEquals() argument 125 String expected, in assertNotEqualsIgnoreCase() argument [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | MathTest.java | 47 long expected = (long) a + (long) b; in testAddExactI() local 49 assertEquals(expected, Math.addExact(a, b)); in testAddExactI() 51 if (expected == a + b) { in testAddExactI() 58 long expected = (long) a - (long) b; in testSubtractExactI() local 60 assertEquals(expected, Math.subtractExact(a, b)); in testSubtractExactI() 63 if (expected == a - b) { in testSubtractExactI() 70 long expected = (long) a * (long) b; in testMultiplyExactI() local 72 assertEquals(expected, Math.multiplyExact(a, b)); in testMultiplyExactI() 74 if (expected == a * b) { in testMultiplyExactI() 81 long expected = (long) a + 1L; in testIncrementExactI() local [all …]
|
D | StrictMathTest.java | 44 long expected = (long) a + (long) b; in testAddExactI() local 46 assertEquals(expected, StrictMath.addExact(a, b)); in testAddExactI() 48 if (expected == a + b) { in testAddExactI() 55 long expected = (long) a - (long) b; in testSubtractExactI() local 57 assertEquals(expected, StrictMath.subtractExact(a, b)); in testSubtractExactI() 60 if (expected == a - b) { in testSubtractExactI() 67 long expected = (long) a * (long) b; in testMultiplyExactI() local 69 assertEquals(expected, StrictMath.multiplyExact(a, b)); in testMultiplyExactI() 71 if (expected == a * b) { in testMultiplyExactI() 97 BigInteger expected = BigInteger.valueOf(a).add(BigInteger.valueOf(b)); in testAddExactL() local [all …]
|
/libcore/ojluni/src/test/java/util/zip/ |
D | ChecksumBase.java | 39 public static void testAll(Checksum checksum, long expected) { in testAll() argument 40 testBytes(checksum, expected); in testAll() 41 testByteArray(checksum, expected); in testAll() 42 testWrappedByteBuffer(checksum, expected); in testAll() 43 testReadonlyByteBuffer(checksum, expected); in testAll() 44 testDirectByteBuffer(checksum, expected); in testAll() 45 testByteArrayOffset(checksum, expected); in testAll() 46 testDirectByteBufferOffset(checksum, expected); in testAll() 47 testLittleEndianDirectByteBufferOffset(checksum, expected); in testAll() 48 testWrappedByteBufferOffset(checksum, expected); in testAll() [all …]
|
/libcore/ojluni/src/test/java/util/HashMap/ |
D | ToArray.java | 52 …private static <T extends Comparable<T>> void checkToArray(String message, T[] expected, Collectio… in checkToArray() argument 55 Arrays.sort(expected); in checkToArray() 57 checkToObjectArray(message, expected, collection, ignoreOrder); in checkToArray() 58 checkToTypedArray(message, expected, Arrays.copyOf(expected, 0), collection, ignoreOrder); in checkToArray() 59 checkToTypedArray(message, expected, expected.clone(), collection, ignoreOrder); in checkToArray() 60 if (expected.length > 0) { in checkToArray() 61 T[] biggerArray = Arrays.copyOf(expected, expected.length * 2); in checkToArray() 62 System.arraycopy(expected, 0, biggerArray, expected.length, expected.length); in checkToArray() 63 checkToTypedArray(message, expected, biggerArray, collection, ignoreOrder); in checkToArray() 67 …private static <T extends Comparable<T>> void checkToTypedArray(String message, T[] expected, T[] … in checkToTypedArray() argument [all …]
|
/libcore/ojluni/src/test/java/time/test/java/time/temporal/ |
D | TestChronoUnit.java | 108 public void test_yearsBetween(LocalDate start, LocalDate end, long expected) { in test_yearsBetween() argument 109 assertEquals(YEARS.between(start, end), expected); in test_yearsBetween() local 113 public void test_yearsBetweenReversed(LocalDate start, LocalDate end, long expected) { in test_yearsBetweenReversed() argument 114 assertEquals(YEARS.between(end, start), -expected); in test_yearsBetweenReversed() 118 …ublic void test_yearsBetween_LocalDateTimeSameTime(LocalDate start, LocalDate end, long expected) { in test_yearsBetween_LocalDateTimeSameTime() argument 119 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 30)), expected); in test_yearsBetween_LocalDateTimeSameTime() 123 …blic void test_yearsBetween_LocalDateTimeLaterTime(LocalDate start, LocalDate end, long expected) { in test_yearsBetween_LocalDateTimeLaterTime() argument 124 if (expected >= 0) { in test_yearsBetween_LocalDateTimeLaterTime() 125 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 31)), expected); in test_yearsBetween_LocalDateTimeLaterTime() 127 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 29)), expected); in test_yearsBetween_LocalDateTimeLaterTime() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/prefs/ |
D | AbstractPreferencesTest.java | 110 } catch (IllegalArgumentException expected) { in testConstructor() 115 } catch (IllegalArgumentException expected) { in testConstructor() 120 } catch (IllegalArgumentException expected) { in testConstructor() 125 } catch (IllegalArgumentException expected) { in testConstructor() 130 } catch (NullPointerException expected) { in testConstructor() 224 } catch (NullPointerException expected) { in testGet() 237 } catch (IllegalStateException expected) { in testGet() 242 } catch (NullPointerException expected) { in testGet() 250 } catch (NullPointerException expected) { in testGetBoolean() 263 } catch (NullPointerException expected) { in testPutByteArray() [all …]
|
/libcore/luni/src/test/java/libcore/javax/crypto/ |
D | SecretKeyFactoryTest.java | 58 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 64 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 70 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 79 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 85 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 91 } catch (InvalidKeySpecException expected) { in test_PBKDF2_required_parameters() 98 } catch (IllegalArgumentException expected) { in test_PBKDF2_required_parameters() 105 } catch (IllegalArgumentException expected) { in test_PBKDF2_required_parameters() 113 byte[] expected = new byte[] { in test_PBKDF2_b3059950() 119 test_PBKDF2_UTF8(PASSWORD, SALT, ITERATIONS, KEY_LENGTH, expected); in test_PBKDF2_b3059950() [all …]
|
/libcore/support/src/test/java/org/apache/harmony/testframework/ |
D | CharSinkTester.java | 83 private static void assertArrayEquals(char[] expected, char[] actual) { in assertArrayEquals() argument 84 Assert.assertEquals(Arrays.toString(expected), Arrays.toString(actual)); in assertArrayEquals() 94 char[] expected = new char[] { }; in sinkTestNoWriting() local 98 assertArrayEquals(expected, getChars()); in sinkTestNoWriting() 102 char[] expected = new char[] { }; in sinkTestWriteZeroChars() local 111 assertArrayEquals(expected, getChars()); in sinkTestWriteZeroChars() 115 char[] expected = "EFGCDECBA".toCharArray(); in sinkTestWriteCharByChar() local 118 for (char c : expected) { in sinkTestWriteCharByChar() 123 assertArrayEquals(expected, getChars()); in sinkTestWriteCharByChar() 127 char[] expected = "EFGCDECBA".toCharArray(); in sinkTestWriteArray() local [all …]
|
D | SinkTester.java | 84 private static void assertArrayEquals(byte[] expected, byte[] actual) { in assertArrayEquals() argument 85 Assert.assertEquals(Arrays.toString(expected), Arrays.toString(actual)); in assertArrayEquals() 95 byte[] expected = new byte[] { }; in sinkTestNoWriting() 99 assertArrayEquals(expected, getBytes()); in sinkTestNoWriting() 103 byte[] expected = new byte[] { }; in sinkTestWriteZeroBytes() 112 assertArrayEquals(expected, getBytes()); in sinkTestWriteZeroBytes() 116 byte[] expected = new byte[] { 5, 6, 7, 3, 4, 5, 3, 2, 1 }; in sinkTestWriteByteByByte() 119 for (byte b : expected) { in sinkTestWriteByteByByte() 124 assertArrayEquals(expected, getBytes()); in sinkTestWriteByteByByte() 128 byte[] expected = new byte[] { in sinkTestWriteArray() [all …]
|
/libcore/luni/src/test/java/libcore/java/net/ |
D | UrlEncodingTest.java | 55 } catch (URISyntaxException expected) { in testDecodingSpace() 69 } catch (URISyntaxException expected) { in testUriDecodingPartial() 74 } catch (URISyntaxException expected) { in testUriDecodingPartial() 82 } catch (IllegalArgumentException expected) { in testUrlDecoderDecodingPartial() 87 } catch (IllegalArgumentException expected) { in testUrlDecoderDecodingPartial() 95 } catch (URISyntaxException expected) { in testUriDecodingInvalid() 103 } catch (IllegalArgumentException expected) { in testUrlDecoderDecodingInvalid() 111 } catch (IllegalCharsetNameException expected) { in testUrlDecoderFailsOnNullCharset() 112 } catch (NullPointerException expected) { in testUrlDecoderFailsOnNullCharset() 120 } catch (IllegalCharsetNameException expected) { in testUrlDecoderFailsOnEmptyCharset() [all …]
|
/libcore/luni/src/test/java/libcore/java/sql/ |
D | TimestampTest.java | 74 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 79 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 84 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 89 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 94 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 99 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 104 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 109 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 114 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() 119 } catch (IllegalArgumentException expected) { } in testValueOfInvalid() [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/format/ |
D | TCKZoneIdPrinterParser.java | 115 public void test_print(LocalDateTime ldt, ZoneId zone, String expected) { in test_print() argument 119 assertEquals(output, expected); in test_print() 123 public void test_print_pattern_VV(LocalDateTime ldt, ZoneId zone, String expected) { in test_print_pattern_VV() argument 127 assertEquals(output, expected); in test_print_pattern_VV() 213 … String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) in test_ZoneId_parseSuccess_plain() argument 216 test(text, expectedIndex, expectedErrorIndex, expected, isZoneOffset); in test_ZoneId_parseSuccess_plain() 221 … String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) in test_ZoneId_parseSuccess_prefix() argument 228 expected, isZoneOffset); in test_ZoneId_parseSuccess_prefix() 233 … String text, int expectedIndex, int expectedErrorIndex, ZoneId expected, boolean isZoneOffset) in test_ZoneId_parseSuccess_suffix() argument 236 test(text + "XXX", expectedIndex, expectedErrorIndex, expected, isZoneOffset); in test_ZoneId_parseSuccess_suffix() [all …]
|
/libcore/ojluni/src/test/java/nio/Buffer/ |
D | Basic.java | 85 String expected, char expectedChar, in fail() argument 104 + expected in fail() 109 static void fail(Buffer b, long expected, long got) { in fail() argument 111 Long.toHexString(expected), (char)expected, in fail() 120 static void ck(Buffer b, long got, long expected) { in ck() argument 121 if (expected != got) in ck() 122 fail(b, expected, got); in ck() 125 static void ck(Buffer b, float got, float expected) { in ck() argument 126 if (expected != got) in ck() 128 Float.toString(expected), (char)expected, in ck() [all …]
|