Home
last modified time | relevance | path

Searched refs:compareTo (Results 1 – 25 of 254) sorted by relevance

1234567891011

/libcore/ojluni/src/test/java/time/tck/java/time/zone/
DTCKZoneOffsetTransition.java185 assertEquals(a.compareTo(a) == 0, true); in test_compareTo()
186 assertEquals(a.compareTo(b) < 0, true); in test_compareTo()
187 assertEquals(a.compareTo(c) < 0, true); in test_compareTo()
189 assertEquals(b.compareTo(a) > 0, true); in test_compareTo()
190 assertEquals(b.compareTo(b) == 0, true); in test_compareTo()
191 assertEquals(b.compareTo(c) < 0, true); in test_compareTo()
193 assertEquals(c.compareTo(a) > 0, true); in test_compareTo()
194 assertEquals(c.compareTo(b) > 0, true); in test_compareTo()
195 assertEquals(c.compareTo(c) == 0, true); in test_compareTo()
207 assertEquals(a.compareTo(a) == 0, true); in test_compareTo_sameInstant()
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalScaleOperationsTest.java86 assertEquals(0, x1.compareTo(x2)); in testSetScale()
87 assertEquals(0, x2.compareTo(x1)); in testSetScale()
91 assertEquals(0, x1.compareTo(x2)); in testSetScale()
92 assertEquals(0, x2.compareTo(x1)); in testSetScale()
96 assertEquals(0, x1.compareTo(x2)); in testSetScale()
97 assertEquals(0, x2.compareTo(x1)); in testSetScale()
/libcore/luni/src/test/java/libcore/java/lang/
DOldAndroidEnumTest.java40 assertTrue(MyEnum.ZERO.compareTo(MyEnum.ONE) < 0); in testEnum()
42 assertTrue(MyEnum.TWO.compareTo(MyEnum.ONE) > 0); in testEnum()
43 assertTrue(MyEnum.FOUR.compareTo(MyEnum.ONE) > 0); in testEnum()
DStringTest.java539 assertEquals(-1, "a".compareTo("b")); in test_compareTo()
540 assertEquals(-2, "a".compareTo("c")); in test_compareTo()
541 assertEquals(1, "b".compareTo("a")); in test_compareTo()
542 assertEquals(2, "c".compareTo("a")); in test_compareTo()
546 assertEquals(0, "a".compareTo("a")); in test_compareTo()
547 assertEquals(-1, "a".compareTo("aa")); in test_compareTo()
548 assertEquals(-1, "a".compareTo("az")); in test_compareTo()
549 assertEquals(-2, "a".compareTo("aaa")); in test_compareTo()
550 assertEquals(-2, "a".compareTo("azz")); in test_compareTo()
551 assertEquals(-3, "a".compareTo("aaaa")); in test_compareTo()
[all …]
/libcore/luni/src/main/java/libcore/icu/
DCollationKeyICU.java30 public int compareTo(CollationKey other) { in compareTo() method in CollationKeyICU
39 return key.compareTo(otherKey); in compareTo()
50 return compareTo((CollationKey) object) == 0; in equals()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigIntegerCompareTest.java77 assertEquals(1, aNumber.compareTo(bNumber)); in testCompareToPosPos1()
92 assertEquals(-1, aNumber.compareTo(bNumber)); in testCompareToPosPos2()
106 assertEquals(0, aNumber.compareTo(bNumber)); in testCompareToEqualPos()
121 assertEquals(-1, aNumber.compareTo(bNumber)); in testCompareToNegNeg1()
136 assertEquals(1, aNumber.compareTo(bNumber)); in testCompareNegNeg2()
150 assertEquals(0, aNumber.compareTo(bNumber)); in testCompareToEqualNeg()
165 assertEquals(1, aNumber.compareTo(bNumber)); in testCompareToDiffSigns1()
180 assertEquals(-1, aNumber.compareTo(bNumber)); in testCompareToDiffSigns2()
192 assertEquals(1, aNumber.compareTo(bNumber)); in testCompareToPosZero()
204 assertEquals(-1, aNumber.compareTo(bNumber)); in testCompareToZeroPos()
[all …]
DOldBigIntegerTest.java52 assertTrue("Random number is negative", bi.compareTo(BigInteger.ZERO) >= 0); in test_ConstructorILjava_util_Random()
53 assertTrue("Random number is too big", bi.compareTo(two.pow(70)) < 0); in test_ConstructorILjava_util_Random()
74 assertTrue(bi1 + " is negative", bi1.compareTo(BigInteger.ZERO) >= 0); in test_ConstructorIILjava_util_Random()
75 assertTrue(bi1 + " is too big", bi1.compareTo(new BigInteger("1024", 10)) < 0); in test_ConstructorIILjava_util_Random()
76 assertTrue(bi2 + " is negative", bi2.compareTo(BigInteger.ZERO) >= 0); in test_ConstructorIILjava_util_Random()
77 assertTrue(bi2 + " is too big", bi2.compareTo(new BigInteger("1024", 10)) < 0); in test_ConstructorIILjava_util_Random()
DBigIntegerTest.java89 assertTrue("Random number is negative", bi.compareTo(zero) >= 0); in test_ConstructorILjava_util_Random()
91 bi.compareTo(twoToTheSeventy) < 0); in test_ConstructorILjava_util_Random()
227 assertTrue("Smaller number returned >= 0", one.compareTo(two) < 0); in test_compareToLjava_math_BigInteger()
228 assertTrue("Larger number returned >= 0", two.compareTo(one) > 0); in test_compareToLjava_math_BigInteger()
229 assertTrue("Equal numbers did not return 0", one.compareTo(one) == 0); in test_compareToLjava_math_BigInteger()
231 two.negate().compareTo(one) < 0); in test_compareToLjava_math_BigInteger()
376 .compareTo(mod) < 0); in test_modInverseLjava_math_BigInteger()
379 .compareTo(BigInteger.ZERO) >= 0); in test_modInverseLjava_math_BigInteger()
397 .compareTo(mod) < 0); in test_modInverseLjava_math_BigInteger()
400 .compareTo(BigInteger.ZERO) >= 0); in test_modInverseLjava_math_BigInteger()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DByteTest.java361 assertTrue(max.compareTo(max) == 0); in test_compareToLjava_lang_Byte()
362 assertTrue(min.compareTo(min) == 0); in test_compareToLjava_lang_Byte()
363 assertTrue(zero.compareTo(zero) == 0); in test_compareToLjava_lang_Byte()
365 assertTrue(max.compareTo(zero) > 0); in test_compareToLjava_lang_Byte()
366 assertTrue(max.compareTo(min) > 0); in test_compareToLjava_lang_Byte()
368 assertTrue(zero.compareTo(max) < 0); in test_compareToLjava_lang_Byte()
369 assertTrue(zero.compareTo(min) > 0); in test_compareToLjava_lang_Byte()
371 assertTrue(min.compareTo(zero) < 0); in test_compareToLjava_lang_Byte()
372 assertTrue(min.compareTo(max) < 0); in test_compareToLjava_lang_Byte()
375 min.compareTo(null); in test_compareToLjava_lang_Byte()
[all …]
DBooleanTest.java146 assertTrue(Boolean.TRUE.compareTo(Boolean.TRUE) == 0); in test_compareToLjava_lang_Boolean()
147 assertTrue(Boolean.FALSE.compareTo(Boolean.FALSE) == 0); in test_compareToLjava_lang_Boolean()
148 assertTrue(Boolean.TRUE.compareTo(Boolean.FALSE) > 0); in test_compareToLjava_lang_Boolean()
149 assertTrue(Boolean.FALSE.compareTo(Boolean.TRUE) < 0); in test_compareToLjava_lang_Boolean()
152 Boolean.TRUE.compareTo(null); in test_compareToLjava_lang_Boolean()
DEnumTest.java60 assertTrue(0 < Sample.MOE.compareTo(Sample.LARRY)); in test_compareToLjava_lang_Enum()
61 assertEquals(0, Sample.MOE.compareTo(Sample.MOE)); in test_compareToLjava_lang_Enum()
62 assertTrue(0 > Sample.MOE.compareTo(Sample.CURLY)); in test_compareToLjava_lang_Enum()
64 Sample.MOE.compareTo((Sample) null); in test_compareToLjava_lang_Enum()
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKOffsetDateTime.java1307 assertEquals(a.compareTo(b) < 0, true);
1308 assertEquals(b.compareTo(a) > 0, true);
1309 assertEquals(a.compareTo(a) == 0, true);
1310 assertEquals(b.compareTo(b) == 0, true);
1311 assertEquals(a.toInstant().compareTo(b.toInstant()) < 0, true);
1319 assertEquals(a.compareTo(b) < 0, true);
1320 assertEquals(b.compareTo(a) > 0, true);
1321 assertEquals(a.compareTo(a) == 0, true);
1322 assertEquals(b.compareTo(b) == 0, true);
1323 assertEquals(a.toInstant().compareTo(b.toInstant()) < 0, true);
[all …]
DTCKOffsetTime.java1157 assertEquals(a.compareTo(b) < 0, true);
1158 assertEquals(b.compareTo(a) > 0, true);
1159 assertEquals(a.compareTo(a) == 0, true);
1160 assertEquals(b.compareTo(b) == 0, true);
1161 assertEquals(convertInstant(a).compareTo(convertInstant(b)) < 0, true);
1168 assertEquals(a.compareTo(b) < 0, true);
1169 assertEquals(b.compareTo(a) > 0, true);
1170 assertEquals(a.compareTo(a) == 0, true);
1171 assertEquals(b.compareTo(b) == 0, true);
1172 assertEquals(convertInstant(a).compareTo(convertInstant(b)) < 0, true);
[all …]
/libcore/ojluni/src/main/java/java/util/
DComparableTimSort.java262 if (pivot.compareTo(a[mid]) < 0) in binarySort()
320 if (((Comparable) a[runHi++]).compareTo(a[lo]) < 0) { // Descending in countRunAndMakeAscending()
321 while (runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) < 0) in countRunAndMakeAscending()
325 while (runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) >= 0) in countRunAndMakeAscending()
509 if (key.compareTo(a[base + hint]) > 0) { in gallopLeft()
512 while (ofs < maxOfs && key.compareTo(a[base + hint + ofs]) > 0) { in gallopLeft()
527 while (ofs < maxOfs && key.compareTo(a[base + hint - ofs]) <= 0) { in gallopLeft()
552 if (key.compareTo(a[base + m]) > 0) in gallopLeft()
579 if (key.compareTo(a[base + hint]) < 0) { in gallopRight()
582 while (ofs < maxOfs && key.compareTo(a[base + hint - ofs]) < 0) { in gallopRight()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
DMacThread.java52 if (sign1.compareTo(sign2) != 0 || sign1.compareTo(sign3) == 0 || in test()
53 sign2.compareTo(sign3) == 0) { in test()
/libcore/ojluni/src/main/java/java/time/temporal/
DChronoUnit.java227 return this.compareTo(DAYS) >= 0; in isDurationEstimated()
241 return this.compareTo(DAYS) >= 0 && this != FOREVER; in isDateBased()
254 return this.compareTo(DAYS) < 0; in isTimeBased()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetTest.java531 assertEquals(0, c1.compareTo(c1)); in testCompareTo_Normal()
534 assertEquals(0, c1.compareTo(c2)); in testCompareTo_Normal()
537 assertTrue(c1.compareTo(c2) < 0); in testCompareTo_Normal()
538 assertTrue(c2.compareTo(c1) > 0); in testCompareTo_Normal()
541 assertTrue(c1.compareTo(c2) > 0); in testCompareTo_Normal()
542 assertTrue(c2.compareTo(c1) < 0); in testCompareTo_Normal()
545 assertTrue(c1.compareTo(c2) > 0); in testCompareTo_Normal()
546 assertTrue(c2.compareTo(c1) < 0); in testCompareTo_Normal()
549 assertEquals("mock".compareToIgnoreCase("m:"), c1.compareTo(c2)); in testCompareTo_Normal()
550 assertEquals("m:".compareToIgnoreCase("mock"), c2.compareTo(c1)); in testCompareTo_Normal()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DFloatBufferTest.java162 buf.compareTo(null); in testCompareTo()
169 assertEquals(0, buf.compareTo(buf)); in testCompareTo()
176 assertEquals(0, buf.compareTo(other)); in testCompareTo()
177 assertEquals(0, other.compareTo(buf)); in testCompareTo()
179 assertTrue(buf.compareTo(other) > 0); in testCompareTo()
180 assertTrue(other.compareTo(buf) < 0); in testCompareTo()
182 assertTrue(buf.compareTo(other) < 0); in testCompareTo()
183 assertTrue(other.compareTo(buf) > 0); in testCompareTo()
186 assertTrue(buf.compareTo(other) > 0); in testCompareTo()
187 assertTrue(other.compareTo(buf) < 0); in testCompareTo()
[all …]
DDoubleBufferTest.java186 assertEquals(0, buf.compareTo(other)); in testCompareTo()
187 assertEquals(0, other.compareTo(buf)); in testCompareTo()
189 assertTrue(buf.compareTo(other) > 0); in testCompareTo()
190 assertTrue(other.compareTo(buf) < 0); in testCompareTo()
192 assertTrue(buf.compareTo(other) < 0); in testCompareTo()
193 assertTrue(other.compareTo(buf) > 0); in testCompareTo()
196 assertTrue(buf.compareTo(other) > 0); in testCompareTo()
197 assertTrue(other.compareTo(buf) < 0); in testCompareTo()
204 .compareTo(dbuffer2)); in testCompareTo()
206 .compareTo(dbuffer1)); in testCompareTo()
[all …]
/libcore/luni/src/test/java/libcore/java/util/function/
DBinaryOperatorTest.java27 Comparator<String> stringComparator = String::compareTo; in testMinBy()
39 Comparator<String> stringComparator = String::compareTo; in testMaxBy()
/libcore/ojluni/src/main/java/java/sql/
DTimestamp.java447 return compareTo(ts) < 0; in before()
459 return compareTo(ts) > 0; in after()
475 public int compareTo(Timestamp ts) { in compareTo() method in Timestamp
504 public int compareTo(java.util.Date o) { in compareTo() method in Timestamp
509 return compareTo((Timestamp)o); in compareTo()
514 return this.compareTo(ts); in compareTo()
/libcore/luni/src/test/java/libcore/java/time/chrono/
DChronologyTest.java55 int chronologyResult = c1.compareTo(c2); in assertComparesAccordingToId()
56 int idResult = c1.getId().compareTo(c2.getId()); in assertComparesAccordingToId()
68 IsoChronology.INSTANCE.compareTo(null); in test_compareTo_null()
/libcore/ojluni/src/test/java/time/test/java/time/
DTestMonthDay.java128 assertTrue(a.compareTo(b) < 0, a + " <=> " + b); in doTest_comparisons_MonthDay()
133 assertTrue(a.compareTo(b) > 0, a + " <=> " + b); in doTest_comparisons_MonthDay()
138 assertEquals(a.compareTo(b), 0, a + " <=> " + b); in doTest_comparisons_MonthDay()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/
DX509CertificateTest.java275 .compareTo(na_date) > 0); in testCheckValidity1()
277 .compareTo(nb_date) < 0); in testCheckValidity1()
280 date.compareTo(na_date) > 0); in testCheckValidity1()
283 date.compareTo(nb_date) < 0); in testCheckValidity1()
323 .compareTo(na_date) > 0); in testCheckValidity2()
325 .compareTo(nb_date) < 0); in testCheckValidity2()
328 date[i].compareTo(na_date) > 0); in testCheckValidity2()
331 + "was thrown", date[i].compareTo(nb_date) < 0); in testCheckValidity2()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoLocalDateTime.java499 default int compareTo(ChronoLocalDateTime<?> other) { in compareTo() method
500 int cmp = toLocalDate().compareTo(other.toLocalDate()); in compareTo()
502 cmp = toLocalTime().compareTo(other.toLocalTime()); in compareTo()
504 cmp = getChronology().compareTo(other.getChronology()); in compareTo()

1234567891011