]> source.dussan.org Git - poi.git/commitdiff
bug 59858: add disabled unit test for bug 59858; file from Brooke
authorJaven O'Neal <onealj@apache.org>
Fri, 15 Jul 2016 05:28:29 +0000 (05:28 +0000)
committerJaven O'Neal <onealj@apache.org>
Fri, 15 Jul 2016 05:28:29 +0000 (05:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1752776 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
test-data/spreadsheet/59858.xls [new file with mode: 0644]

index 4d844a6db731662127851a524333f194b20f0420..6d2e9fe40d9f0a1f3f41e8438507e0a3b088bb0e 100644 (file)
@@ -20,6 +20,8 @@ package org.apache.poi.poifs.macros;
 import static org.apache.poi.POITestCase.assertContains;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -259,4 +261,18 @@ public class TestVBAMacroReader {
         assertNotNull(macros);
         reader.close();
     }
+    
+    // This test is written as expected-to-fail and should be rewritten
+    // as expected-to-pass when the bug is fixed.
+    @Test
+    public void bug59858() throws IOException {
+        try {
+            fromFile(POIDataSamples.getSpreadSheetInstance(), "59858.xls");
+            fail("This test passes now. Please update the unit test and bug 59858.");
+        } catch (NullPointerException e) {
+            e.printStackTrace();
+            // NPE when reading module.offset in VBAMacroReader.readMacros (approx line 258)
+            assumeTrue("This test currently fails with an NPE. See stdout.", false);
+        }
+    }
 }
diff --git a/test-data/spreadsheet/59858.xls b/test-data/spreadsheet/59858.xls
new file mode 100644 (file)
index 0000000..4f66c6d
Binary files /dev/null and b/test-data/spreadsheet/59858.xls differ