From 42c4e7d89ac33f4a71fd57d87666dd1a89bbf118 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 30 Dec 2020 21:40:01 +0000 Subject: [PATCH] Add unfixed test for bug 64759 and make the ones fail which depend on manual opening of files in Microsoft Excel for verification git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884957 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/stress/TestAllFiles.java | 1 + .../poi/xssf/usermodel/TestUnfixedBugs.java | 15 +++++++++++++++ test-data/spreadsheet/64759.xlsx | Bin 0 -> 11679 bytes 3 files changed, 16 insertions(+) create mode 100644 test-data/spreadsheet/64759.xlsx diff --git a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java index cf059642a7..aa219bc2df 100644 --- a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java @@ -251,6 +251,7 @@ public class TestAllFiles { private static final Set EXPECTED_FAILURES = unmodifiableHashSet( // password protected files without known password "spreadsheet/51832.xls", + "spreadsheet/64759.xlsx", "document/PasswordProtected.doc", // TODO: fails XMLExportTest, is this ok? diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java index 925a878a53..64d4c15f5f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java @@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -217,6 +218,8 @@ public final class TestUnfixedBugs { // write to file for manual inspection XSSFTestDataSamples.writeOut(wb, "bug 55752 for review"); } + + fail("Test runs ok, but the resulting file is incorrectly formatted"); } @Test @@ -248,6 +251,8 @@ public final class TestUnfixedBugs { checkRows57423(wbBack.getSheetAt(0)); wbBack.close(); + + fail("Excel reports that the workbook is corrupt"); } private void checkRows57423(Sheet testSheet) throws IOException { @@ -326,6 +331,8 @@ public final class TestUnfixedBugs { // LibreOffice doesn't complain when rows are not in ascending order wbBack.close(); + + fail("Excel reports that the workbook is corrupt, LibreOffice can read it"); } } @@ -387,4 +394,12 @@ public final class TestUnfixedBugs { } } + + @Test + public void testBug64759() throws IOException { + try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64759.xlsx")) { + Sheet cloned = wb.cloneSheet(0); + assertNotNull(cloned); + } + } } diff --git a/test-data/spreadsheet/64759.xlsx b/test-data/spreadsheet/64759.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e7b47c94f03af248444a8c9a9b75471863f71116 GIT binary patch literal 11679 zcmeHt1y>zevo`J;+}&LgJOoSd;O=e*m*BzO-JRg>1PBt`-JRg>{+(pzzL{a>et+P; zy;k>;-Sw>QT2INYDj5lI2y_rA5Eu{;5E2l{^oEmcP!JFaC=d`d5Ew9ZAuCIJLrZ&Y z1!rqRJ59z<01M)52r%kQ5HR5V|2_T>YoH`rX>-(_sgVXWTSlXA zL_BF!jHR$Tg1Bag)5l>tw3xKy<>txD+^3n56rG3N$#HCJsYSUko3Tt%rxDRdFgPOJ zd@4#vM7>ZO(6AC}jW9Z2Cd37Gw*+HuL)SlOl~Bum0C|1KsbhTLV|!c-7F~I=rfI@W zrA^mb*3=E$yKyY5FOX9NuF7w=j+*zbwLxE1KE ztRT5}yOO>hE{4b5o0goh{XDc$p7{(80`d&J$o$Q;YZaNvE`WTM1X?aU(6qH}4K3`L z7=K>>YtsLR?f5URUJ@5b@q~wSLi%sbxx)J33oOQ(6p4c@$YR)*1Av~r!J?i zl0Jw#Q#-aq&=xloWJ&a`kiDNc6|O`XVN}M2Ma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