[JGIT PATCH 02/12] Add tests to cover more methods of BinaryHunk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 .../tst/org/spearce/jgit/patch/PatchTest.java      |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchTest.java
index 5850364..ebd23b4 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchTest.java
@@ -199,10 +199,18 @@ assertTrue(fh.getNewName().startsWith(
 			assertTrue(fh.getHunks().isEmpty());
 			assertTrue(fh.hasMetaDataChanges());
 
-			assertNotNull(fh.getForwardBinaryHunk());
-			assertNotNull(fh.getReverseBinaryHunk());
-			assertEquals(binsizes[i], fh.getForwardBinaryHunk().getSize());
-			assertEquals(0, fh.getReverseBinaryHunk().getSize());
+			final BinaryHunk fwd = fh.getForwardBinaryHunk();
+			final BinaryHunk rev = fh.getReverseBinaryHunk();
+			assertNotNull(fwd);
+			assertNotNull(rev);
+			assertEquals(binsizes[i], fwd.getSize());
+			assertEquals(0, rev.getSize());
+
+			assertSame(fh, fwd.getFileHeader());
+			assertSame(fh, rev.getFileHeader());
+
+			assertSame(BinaryHunk.Type.LITERAL_DEFLATED, fwd.getType());
+			assertSame(BinaryHunk.Type.LITERAL_DEFLATED, rev.getType());
 		}
 
 		final FileHeader fh = p.getFiles().get(4);
-- 
1.6.1.rc2.306.ge5d5e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux