Search in sources :

Example 1 with ViewFieldsRecord

use of org.apache.poi.hssf.record.pivottable.ViewFieldsRecord in project poi by apache.

the class TestViewFieldsRecord method testUnicodeFlag_bug46693.

public void testUnicodeFlag_bug46693() {
    byte[] data = HexRead.readFromString("01 00 01 00 01 00 04 00 05 00 00 6D 61 72 63 6F");
    RecordInputStream in = TestcaseRecordInputStream.create(ViewFieldsRecord.sid, data);
    ViewFieldsRecord rec = new ViewFieldsRecord(in);
    if (in.remaining() == 1) {
        throw new AssertionFailedError("Identified bug 46693b");
    }
    assertEquals(0, in.remaining());
    assertEquals(4 + data.length, rec.getRecordSize());
}
Also used : ViewFieldsRecord(org.apache.poi.hssf.record.pivottable.ViewFieldsRecord) AssertionFailedError(junit.framework.AssertionFailedError) RecordInputStream(org.apache.poi.hssf.record.RecordInputStream) TestcaseRecordInputStream(org.apache.poi.hssf.record.TestcaseRecordInputStream)

Example 2 with ViewFieldsRecord

use of org.apache.poi.hssf.record.pivottable.ViewFieldsRecord in project poi by apache.

the class TestViewFieldsRecord method confirmSerialize.

private static ViewFieldsRecord confirmSerialize(String hexDump) {
    byte[] data = HexRead.readFromString(hexDump);
    RecordInputStream in = TestcaseRecordInputStream.create(ViewFieldsRecord.sid, data);
    ViewFieldsRecord rec = new ViewFieldsRecord(in);
    assertEquals(0, in.remaining());
    assertEquals(4 + data.length, rec.getRecordSize());
    byte[] data2 = rec.serialize();
    TestcaseRecordInputStream.confirmRecordEncoding(ViewFieldsRecord.sid, data, data2);
    return rec;
}
Also used : ViewFieldsRecord(org.apache.poi.hssf.record.pivottable.ViewFieldsRecord) RecordInputStream(org.apache.poi.hssf.record.RecordInputStream) TestcaseRecordInputStream(org.apache.poi.hssf.record.TestcaseRecordInputStream)

Aggregations

RecordInputStream (org.apache.poi.hssf.record.RecordInputStream)2 TestcaseRecordInputStream (org.apache.poi.hssf.record.TestcaseRecordInputStream)2 ViewFieldsRecord (org.apache.poi.hssf.record.pivottable.ViewFieldsRecord)2 AssertionFailedError (junit.framework.AssertionFailedError)1