aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2009-03-31 21:12:47 +0000
committerJosh Micich <josh@apache.org>2009-03-31 21:12:47 +0000
commit7dcd9c006bff0ab8e5904145ca310b6a99670895 (patch)
treeddb3de0eb91f1063147efb2b61e4c6c0d47a5cd8 /src/testcases
parent0a0fdba2dc8f7a84c57709014954ac72fee91091 (diff)
downloadpoi-7dcd9c006bff0ab8e5904145ca310b6a99670895.tar.gz
poi-7dcd9c006bff0ab8e5904145ca310b6a99670895.zip
Fix for 46918 - Allow shorter format for ExtendedPivotTableViewFieldsRecord(SXVDEX) record
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@760646 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java b/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
index 7ba15d5c26..945528dd2d 100644
--- a/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
+++ b/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
@@ -51,4 +51,26 @@ public final class TestExtendedPivotTableViewFieldsRecord extends TestCase {
assertEquals(data.length, rec.getRecordSize());
}
+
+ public void testOlderFormat_bug46918() {
+ // There are 10 SXVDEX records in the file (not uploaded) that originated bugzilla 46918
+ // They all had the following hex encoding:
+ byte data[] = HexRead.readFromString("00 01 0A 00 1E 14 00 0A FF FF FF FF 00 00");
+
+ RecordInputStream in = TestcaseRecordInputStream.create(data);
+ ExtendedPivotTableViewFieldsRecord rec;
+ try {
+ rec = new ExtendedPivotTableViewFieldsRecord(in);
+ } catch (RecordFormatException e) {
+ if (e.getMessage().equals("Not enough data (0) to read requested (2) bytes")) {
+ throw new AssertionFailedError("Identified bug 46918");
+ }
+ throw e;
+ }
+
+ byte expReserData[] = HexRead.readFromString("1E 14 00 0A FF FF FF FF 00 00" +
+ "FF FF 00 00 00 00 00 00 00 00");
+
+ TestcaseRecordInputStream.confirmRecordEncoding(ExtendedPivotTableViewFieldsRecord.sid, expReserData, rec.serialize());
+ }
}