diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2014-01-06 12:18:51 +0100 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2014-01-06 12:18:51 +0100 |
commit | b3da8e5c61667c9a6ad17263cb6b230b4417142b (patch) | |
tree | 65fcd3abec781f38615006fe4912766df9c90ebd /org.jacoco.core.test/src/org | |
parent | 283abfa148b749678924b5e75eabd35a2d58f9f8 (diff) | |
download | jacoco-b3da8e5c61667c9a6ad17263cb6b230b4417142b.tar.gz |
Test case with empty ZIP entry (reproducer for #179).
Diffstat (limited to 'org.jacoco.core.test/src/org')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java index d265c285..7e5298aa 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java +++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java @@ -122,6 +122,17 @@ public class AnalyzerTest { } @Test + public void testAnalyzeAll_EmptyZipEntry() throws IOException { + final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + final ZipOutputStream zip = new ZipOutputStream(buffer); + zip.putNextEntry(new ZipEntry("empty.txt")); + zip.finish(); + final int count = analyzer.analyzeAll( + new ByteArrayInputStream(buffer.toByteArray()), "Test"); + assertEquals(0, count); + } + + @Test public void testAnalyzeAll_Pack200() throws IOException { final ByteArrayOutputStream zipbuffer = new ByteArrayOutputStream(); final ZipOutputStream zip = new ZipOutputStream(zipbuffer); |