aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2006-06-13 13:19:14 +0000
committerNick Burch <nick@apache.org>2006-06-13 13:19:14 +0000
commitdb05dbdbba64af366610091937be46d49834ed20 (patch)
tree465adf823c03d21f404b3c4dc0bbcf790dd7e081 /src/testcases
parentc0d50d0c841f4bee76072c5959074fb784e1c74e (diff)
downloadpoi-db05dbdbba64af366610091937be46d49834ed20.tar.gz
poi-db05dbdbba64af366610091937be46d49834ed20.zip
Add a currently broken test, which highlights a bug (bug report to follow)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@413893 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java
index 334eeb49df..ddede8eb41 100644
--- a/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java
+++ b/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java
@@ -154,4 +154,82 @@ public class TestEscherOptRecord extends TestCase
assertEquals( expected, r.toString());
}
+ /**
+ * Test serialisation of a particually complex example
+ * This test is currently broken!
+ */
+ public void BROKENtestComplexSerialise() throws Exception {
+ byte[] data = new byte[] {
+ 0x53, 0x01, 0x0B, 0xF0-256, 0x9C-256, 0x01, 0x00, 0x00, 0x42, 0x01,
+ 0x49, 0x00, 0x00, 0x00, 0x43, 0x01, 0x85-256, 0x00, 0x00,
+ 0x00, 0x44, 0x01, 0x04, 0x00, 0x00, 0x00,
+ 0x45, 0xC1-256, 0x88-256, 0x00, 0x00, 0x00, 0x46, 0xC1-256,
+ 0x90-256, 0x00, 0x00, 0x00, 0x7F, 0x01, 0x01, 0x00,
+ 0x01, 0x00, 0x80-256, 0x01, 0x00, 0x00, 0x00, 0x00, 0x81-256,
+ 0x01, 0x02, 0x00, 0x00, 0x08, 0xBF-256, 0x01,
+ 0x10, 0x00, 0x10, 0x00, 0xC0-256, 0x01, 0x01, 0x00, 0x00, 0x08,
+ 0xC1-256, 0x01, 0x00, 0x00, 0x01, 0x00,
+ 0xC4-256, 0x01, 0x00, 0x00, 0x00, 0x00, 0xCB-256, 0x01, 0x38,
+ 0x63, 0x00, 0x00, 0xCD-256, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0xCE-256, 0x01, 0x00, 0x00, 0x00, 0x00, 0xD0-256,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0xD1-256, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xD7-256, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0xFF-256, 0x01, 0x18, 0x00, 0x18, 0x00,
+ 0x01, 0x02, 0x02, 0x00, 0x00, 0x08, 0x3F, 0x02, 0x00, 0x00,
+ 0x02, 0x00, 0x22, 0x00, 0x22, 0x00,
+ 0xF0-256, 0xFF-256, 0x18, 0x00, 0x28, 0x00, 0x04, 0x00, 0x34,
+ 0x00, 0x04, 0x00, 0x28, 0x00, 0x04, 0x00,
+ 0x1C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x04, 0x00, 0x04, 0x00, 0x10,
+ 0x00, 0x00, 0x00, 0x1C, 0x00,
+ 0x04, 0x00, 0x28, 0x00, 0x10, 0x00, 0x34, 0x00, 0x18, 0x00, 0x3C,
+ 0x00, 0x24, 0x00, 0x44, 0x00,
+ 0x30, 0x00, 0x48, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x48, 0x00, 0x3C,
+ 0x00, 0x54, 0x00, 0x38, 0x00,
+ 0x60, 0x00, 0x2C, 0x00, 0x70, 0x00, 0x20, 0x00, 0x78, 0x00,
+ 0x14, 0x00, 0x80-256, 0x00, 0x08, 0x00,
+ 0x84-256, 0x00, 0x04, 0x00, 0x78, 0x00, 0x04, 0x00, 0x6C, 0x00,
+ 0x04, 0x00, 0x60, 0x00, 0x04, 0x00,
+ 0x54, 0x00, 0x08, 0x00, 0x48, 0x00, 0x0C, 0x00, 0x3C, 0x00, 0x0C,
+ 0x00, 0x30, 0x00, 0x08, 0x00,
+ 0x3C, 0x00, 0x08, 0x00, 0x48, 0x00, 0x08, 0x00, 0x54, 0x00, 0x00,
+ 0x00, 0x48, 0x00, 0x00, 0x00,
+ 0x3C, 0x00, 0x00, 0x00, 0x30, 0x00, 0x04, 0x00, 0x24, 0x00, 0x45,
+ 0x00, 0x48, 0x00, 0x02, 0x00,
+ 0x00, 0x40, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00,
+ 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256,
+ 0x01, 0x00, 0x00, 0xB0-256, 0x01, 0x00, 0x00, 0xB0-256, 0x00, 0x80-256
+ };
+
+ // Create the record
+ EscherOptRecord r = new EscherOptRecord();
+ r.fillFields( data, new DefaultEscherRecordFactory() );
+
+ // Check it's the right length
+ assertEquals(data.length, r.getRecordSize());
+
+ // Serialise it
+ byte[] dest = new byte[data.length];
+ int written = r.serialize(0, dest);
+
+ // Check it serialised it back to the same data
+ assertEquals(data.length, written);
+ for(int i=0; i<data.length; i++) {
+ System.err.println(i);
+ assertEquals(data[i], dest[i]);
+ }
+ }
}