aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst/org/eclipse
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-12-07 16:49:47 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2017-12-07 20:02:59 +0900
commit0ea73f6282c158db144785b4fa809173098b9ebe (patch)
treebfb87790091ff9a61a5e9ff3dde89cc66b30ec29 /org.eclipse.jgit.pgm.test/tst/org/eclipse
parent61790cb931d8b5f932f160ebe80bb8cabe248a75 (diff)
downloadjgit-0ea73f6282c158db144785b4fa809173098b9ebe.tar.gz
jgit-0ea73f6282c158db144785b4fa809173098b9ebe.zip
ArchiveTest: Check result of BufferedInputStream#skip
Change-Id: I5168c75ca2dda6d1e8c8a6c29043ac781fe9295a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
index 6f32bfaa52..3b352ce2aa 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.pgm;
import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeNoException;
@@ -635,7 +636,10 @@ public class ArchiveTest extends CLIRepositoryTestCase {
BufferedInputStream in = new BufferedInputStream(
new FileInputStream(file));
try {
- in.skip(offset);
+ if (offset > 0) {
+ long skipped = in.skip(offset);
+ assertEquals(offset, skipped);
+ }
byte[] actual = new byte[magicBytes.length];
in.read(actual);