poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirk Niggler <nirk.nigg...@gmail.com>
Subject Re: Tests for dev-tools like BiffViewer et.al.
Date Fri, 25 Oct 2013 22:55:02 GMT
The first exception (java.io.FileNotFoundException: no such entry:
"Workbook") appears to stem from a POI bug:

Even though [MS-CFB] doesn't explicitly use the word "uppercase", the CFB
directory entries are definitely supposed to be treated as uppercase.
 v20130118 pages 27-28 describe the algorithm for comparing names:

> For each UTF-16 code point, convert to upper-case with the Unicode
Default Case Conversion Algorithm, simple case conversion variant ... Compare
each upper-cased UTF-16 code point binary value.

I haven't dug deep into the code, but a cursory glance of the POIFS code
reveals no effort to convert the names to uppercase.


On Fri, Oct 25, 2013 at 3:12 PM, Dominik Stadler <dominik.stadler@gmx.at>wrote:

> Hi,
>
> FYI, I just added a few tests which "bash" BiffViewer and other dev-tools
> and verify that they do not fail with any of the test-files that we have
> available in "test-data".
>
> This ensures that existing files can still be read by these tools after
> changes to the code and also that newly added test-files can be read by
> these tools.
>
> A few files currently fail the tests and are excluded to make the tests
> pass, however I am not sure if all of these are ok to be excluded or if
> some are actually code-errors that we should investigate. Can you let me
> know which of the errors listed below indicate a coding-error and should be
> investigated in more detail?
>
> Also let me know comments/suggestions on adding such type of "bashing"
> tests, I think it useful, but they are not strictly unit-tests any more...
>
> Thanks... Dominik.
>
> Failed: WORKBOOK_in_capitals.xls
> Failed: NoGutsRecords.xls
> Failed: BOOK_in_capitals.xls
> Failed: OddStyleRecord.xls
> java.io.FileNotFoundException: no such entry: "Workbook"
>     at
>
> org.apache.poi.poifs.filesystem.DirectoryNode.getEntry(DirectoryNode.java:375)
>     at
>
> org.apache.poi.poifs.filesystem.DirectoryNode.createDocumentInputStream(DirectoryNode.java:177)
>     at
>
> org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocumentInputStream(POIFSFileSystem.java:445)
>     at
> org.apache.poi.hssf.dev.TestBiffViewer.runOneFile(TestBiffViewer.java:33)
>
>
> Failed: password.xls
> Failed: 50833.xls
> Failed: 51832.xls
> java.lang.IllegalArgumentException: Name is too long: ��fܓ� �%
>  i\P��� +� �Z~u� ��]����� �miLÐ '$ ���HR�Yx) ~ZzxId�hؤ�
 8��(
> 9�7O�VB}}q�  �u���Np��X�`���$X��[c
>     at
>
> org.apache.poi.hssf.record.WriteAccessRecord.setUsername(WriteAccessRecord.java:104)
>     at
>
> org.apache.poi.hssf.record.WriteAccessRecord.<init>(WriteAccessRecord.java:72)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecord(BiffViewer.java:253)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:83)
>     at
> org.apache.poi.hssf.dev.BiffViewer.runBiffViewer(BiffViewer.java:427)
>     at
> org.apache.poi.hssf.dev.TestBiffViewer.runOneFile(TestBiffViewer.java:36)
>
>
>
> Failed: XRefCalc.xls
> java.lang.RuntimeException: Buffer overrun
>     at
>
> org.apache.poi.util.LittleEndianByteArrayInputStream.checkPosition(LittleEndianByteArrayInputStream.java:47)
>     at
>
> org.apache.poi.util.LittleEndianByteArrayInputStream.readUShort(LittleEndianByteArrayInputStream.java:100)
>     at
>
> org.apache.poi.util.LittleEndianByteArrayInputStream.readShort(LittleEndianByteArrayInputStream.java:93)
>     at org.apache.poi.ss.formula.ptg.ExpPtg.<init>(ExpPtg.java:36)
>     at org.apache.poi.ss.formula.ptg.Ptg.createBasePtg(Ptg.java:129)
>     at org.apache.poi.ss.formula.ptg.Ptg.createPtg(Ptg.java:82)
>     at org.apache.poi.ss.formula.ptg.Ptg.readTokens(Ptg.java:56)
>     at org.apache.poi.ss.formula.Formula.getTokens(Formula.java:82)
>     at
>
> org.apache.poi.hssf.record.ExternalNameRecord.toString(ExternalNameRecord.java:212)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:94)
>     at
> org.apache.poi.hssf.dev.BiffViewer.runBiffViewer(BiffViewer.java:427)
>     at
> org.apache.poi.hssf.dev.TestBiffViewer.runOneFile(TestBiffViewer.java:36)
>
>
> Failed: 46904.xls
> Failed: 43493.xls
> org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
> Initialisation of record 0x10 left 8 bytes remaining still to be read.
>     at
>
> org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:67)
>     at
> org.apache.poi.hssf.dev.BiffViewer.runBiffViewer(BiffViewer.java:427)
>     at
> org.apache.poi.hssf.dev.TestBiffViewer.runOneFile(TestBiffViewer.java:36)
> Discarding 8 bytes and continuing
>
>
> Failed: 43493.xls
> org.apache.poi.hssf.record.RecordFormatException: Expected size 18 but got
> (0)
>     at
>
> org.apache.poi.hssf.record.CommonObjectDataSubRecord.<init>(CommonObjectDataSubRecord.java:86)
>     at
> org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:49)
>     at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:93)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecord(BiffViewer.java:202)
>     at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:83)
>     at
> org.apache.poi.hssf.dev.BiffViewer.runBiffViewer(BiffViewer.java:427)
>     at
> org.apache.poi.hssf.dev.TestBiffViewer.runOneFile(TestBiffViewer.java:36)
>
>
> Failed: 49219.xlsjava.lang.NullPointerException
>     at
>
> org.apache.poi.ss.formula.constant.ConstantValueParser.getEncodedSize(ConstantValueParser.java:93)
>     at
>
> org.apache.poi.hssf.record.ExternalNameRecord.getDataSize(ExternalNameRecord.java:135)
>     at
>
> org.apache.poi.hssf.record.StandardRecord.getRecordSize(StandardRecord.java:32)
>     at
>
> org.apache.poi.hssf.model.InternalWorkbook.getSize(InternalWorkbook.java:1039)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:1299)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1210)
>     at org.apache.poi.hssf.dev.ReSave.main(ReSave.java:56)
>     at org.apache.poi.hssf.dev.TestReSave.runOneFile(TestReSave.java:32)
>
>
> Failed: password.xls
> Failed: 51832.xls
> org.apache.poi.EncryptedDocumentException: Default password is invalid for
> docId/saltData/saltHash
>     at
>
> org.apache.poi.hssf.record.RecordFactoryInputStream$StreamEncryptionInfo.createDecryptingStream(RecordFactoryInputStream.java:116)
>     at
>
> org.apache.poi.hssf.record.RecordFactoryInputStream.<init>(RecordFactoryInputStream.java:184)
>     at
>
> org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:440)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:314)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:277)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:211)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:355)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:336)
>     at org.apache.poi.hssf.dev.ReSave.main(ReSave.java:42)
>     at org.apache.poi.hssf.dev.TestReSave.runOneFile(TestReSave.java:32)
>
>
> Failed: 49931.xls
> java.lang.IllegalStateException: Found more than one PageSettingsBlock in
> custom view settings sub-stream
>     at
>
> org.apache.poi.hssf.record.aggregates.CustomViewSettingsRecordAggregate.<init>(CustomViewSettingsRecordAggregate.java:51)
>     at
> org.apache.poi.hssf.model.InternalSheet.<init>(InternalSheet.java:174)
>     at
> org.apache.poi.hssf.model.InternalSheet.createSheet(InternalSheet.java:121)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:324)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:277)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:211)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:355)
>     at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:336)
>     at org.apache.poi.hssf.dev.ReSave.main(ReSave.java:42)
>     at org.apache.poi.hssf.dev.TestReSave.runOneFile(TestReSave.java:35)
>
> Had 301 files
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message