From c569ba02e60d3abc79a895ad3921e488e922bed7 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 10 May 2006 13:24:54 +0000 Subject: [PATCH] Add test for empty constructor git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@405757 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hslf/record/TestTextCharsAtom.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java index f2aa221149..5c800a9ad8 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java @@ -65,7 +65,7 @@ public class TestTextCharsAtom extends TestCase { assertEquals(alt_data[i],b[i]); } } - + public void testWrite() throws Exception { TextCharsAtom tca = new TextCharsAtom(data,0,data.length); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -77,4 +77,23 @@ public class TestTextCharsAtom extends TestCase { assertEquals(data[i],b[i]); } } + + public void testCreateNew() throws Exception { + TextCharsAtom tca = new TextCharsAtom(); + assertEquals(0, tca.getText().length()); + + tca.setText(data_text); + assertEquals(data_text, tca.getText()); + + // Check it's now like data + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + tca.writeOut(baos); + byte[] b = baos.toByteArray(); + + assertEquals(data.length, b.length); + for(int i=0; i