summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-03-17 09:29:31 +0000
committerNarayan Kamath <narayan@google.com>2015-03-17 10:04:59 +0000
commit8a0d507642f3365fd2969445ba0df282e46af72d (patch)
treee37aae8e0fbb4610feffbad990e6dda853385b21
parent79c17dc2b392201f55c700781408d4af625c82a5 (diff)
downloadlibcore-8a0d507642f3365fd2969445ba0df282e46af72d.zip
libcore-8a0d507642f3365fd2969445ba0df282e46af72d.tar.gz
libcore-8a0d507642f3365fd2969445ba0df282e46af72d.tar.bz2
Add unit test for Timestamp#equals.
bug: 19756610 Change-Id: I2654643fefcb0402e34ff409c0cad1e1355cadc3
-rw-r--r--luni/src/test/java/libcore/java/sql/TimestampTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/sql/TimestampTest.java b/luni/src/test/java/libcore/java/sql/TimestampTest.java
index 2985848..71ac8c8 100644
--- a/luni/src/test/java/libcore/java/sql/TimestampTest.java
+++ b/luni/src/test/java/libcore/java/sql/TimestampTest.java
@@ -144,4 +144,12 @@ public final class TimestampTest extends TestCase {
} catch (IllegalArgumentException expected) { }
}
+ // http://b/19756610
+ public void testAsymmetricEquals() {
+ Timestamp timestamp = new Timestamp(0);
+ java.util.Date date = new java.util.Date(0);
+
+ assertTrue(date.equals(timestamp));
+ assertFalse(timestamp.equals(date));
+ }
}