Browse Source

ArchiveTest: Check result of BufferedInputStream#skip

Change-Id: I5168c75ca2dda6d1e8c8a6c29043ac781fe9295a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
tags/v4.10.0.201712302008-r
David Pursehouse 6 years ago
parent
commit
0ea73f6282

+ 5
- 1
org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java View File

@@ -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);

Loading…
Cancel
Save