aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/poifs
diff options
context:
space:
mode:
authorTim Allison <tallison@apache.org>2016-10-18 16:43:20 +0000
committerTim Allison <tallison@apache.org>2016-10-18 16:43:20 +0000
commit64051349494e0722abd477866483fbae29723fe2 (patch)
tree9b58c5b2f0f61577162eb42468c00e9d68a25fa4 /src/testcases/org/apache/poi/poifs
parent1ec787c3562dcb91f1ddd8581efe393ceea75a51 (diff)
downloadpoi-64051349494e0722abd477866483fbae29723fe2.tar.gz
poi-64051349494e0722abd477866483fbae29723fe2.zip
BUG 59858 -- avoid npe when there's a collision of record names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765479 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/poifs')
-rw-r--r--src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
index f622c54867..3a4c47361d 100644
--- a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
+++ b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
@@ -254,24 +254,14 @@ public class TestVBAMacroReader {
assertNotNull(macros.get("Module20"));
assertContains(macros.get("Module20"), "here start of superscripting");
}
-
- // 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");
- testPassesNow(59858);
- } catch (IOException e) {
- if (e.getMessage().matches("Module offset for '.+' was never read.")) {
- //e.printStackTrace();
- // NPE when reading module.offset in VBAMacroReader.readMacros (approx line 258)
- skipTest(e);
- } else {
- // something unexpected failed
- throw e;
- }
- }
+ File f = POIDataSamples.getSpreadSheetInstance().getFile("59830.xls");
+ VBAMacroReader r = new VBAMacroReader(f);
+ Map<String, String> macros = r.readMacros();
+ assertNotNull(macros.get("Module20"));
+ assertContains(macros.get("Module20"), "start of superscripting");
}
@Test