]> source.dussan.org Git - jgit.git/commitdiff
LongObjectIdTest: Add back self comparison test 65/103265/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Thu, 17 Aug 2017 22:15:30 +0000 (23:15 +0100)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 18 Aug 2017 09:01:06 +0000 (10:01 +0100)
The test was removed in 4886621 to prevent a warning from
error-prone.

Add it back but rewrite it in a way that does not cause the
warning.

This reverts commit 4886621261c3b5fa2d9c75fd72d19ac186c9f970.

Change-Id: Id3994e2d882a9d08bf548b7778406f8a80fbf830
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java

index e754d6f744b5c6da013bb442574a0e7113439048..31ab783e2a2c7ba830ed53d25135d418e7477908 100644 (file)
@@ -291,6 +291,8 @@ public class LongObjectIdTest {
                                "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef");
                assertEquals(0, id1.compareTo(LongObjectId.fromString(
                                "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")));
+               AnyLongObjectId self = id1;
+               assertEquals(0, id1.compareTo(self));
 
                assertEquals(-1, id1.compareTo(LongObjectId.fromString(
                                "1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")));