diff options
author | Josh Micich <josh@apache.org> | 2008-10-24 00:58:49 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-10-24 00:58:49 +0000 |
commit | b4265b89039ac2ddd7be69fd2955834cf72f4a33 (patch) | |
tree | 935e8c4a298be87739c606cef7388ba02503e198 /src/testcases/org/apache/poi/util | |
parent | 4f54a9b5576aad8a8a8dc795b4f0edabbeb6bb14 (diff) | |
download | poi-b4265b89039ac2ddd7be69fd2955834cf72f4a33.tar.gz poi-b4265b89039ac2ddd7be69fd2955834cf72f4a33.zip |
Fix for unicode string bug in StyleRecord. Improvements to WriteAccessRecord.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@707519 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/util')
-rw-r--r-- | src/testcases/org/apache/poi/util/TestStringUtil.java | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/src/testcases/org/apache/poi/util/TestStringUtil.java b/src/testcases/org/apache/poi/util/TestStringUtil.java index b22439cd09..f1b5cfd954 100644 --- a/src/testcases/org/apache/poi/util/TestStringUtil.java +++ b/src/testcases/org/apache/poi/util/TestStringUtil.java @@ -42,43 +42,7 @@ public class TestStringUtil super( name ); } - /** - * test simple form of getFromUnicode - */ - public void testSimpleGetFromUnicode() - { - byte[] test_data = new byte[32]; - int index = 0; - - for ( int k = 0; k < 16; k++ ) - { - test_data[index++] = (byte) 0; - test_data[index++] = (byte) ( 'a' + k ); - } - - assertEquals( "abcdefghijklmnop", - StringUtil.getFromUnicodeBE( test_data ) ); - } - - /** - * test simple form of getFromUnicode with symbols with code below and more 127 - */ - public void testGetFromUnicodeSymbolsWithCodesMoreThan127() - { - byte[] test_data = new byte[]{0x04, 0x22, - 0x04, 0x35, - 0x04, 0x41, - 0x04, 0x42, - 0x00, 0x20, - 0x00, 0x74, - 0x00, 0x65, - 0x00, 0x73, - 0x00, 0x74, - }; - assertEquals( "\u0422\u0435\u0441\u0442 test", - StringUtil.getFromUnicodeBE( test_data ) ); - } /** * test getFromUnicodeHigh for symbols with code below and more 127 @@ -101,62 +65,7 @@ public class TestStringUtil StringUtil.getFromUnicodeLE( test_data ) ); } - /** - * Test more complex form of getFromUnicode - */ - public void testComplexGetFromUnicode() - { - byte[] test_data = new byte[32]; - int index = 0; - for ( int k = 0; k < 16; k++ ) - { - test_data[index++] = (byte) 0; - test_data[index++] = (byte) ( 'a' + k ); - } - assertEquals( "abcdefghijklmno", - StringUtil.getFromUnicodeBE( test_data, 0, 15 ) ); - assertEquals( "bcdefghijklmnop", - StringUtil.getFromUnicodeBE( test_data, 2, 15 ) ); - try - { - StringUtil.getFromUnicodeBE( test_data, -1, 16 ); - fail( "Should have caught ArrayIndexOutOfBoundsException" ); - } - catch ( ArrayIndexOutOfBoundsException ignored ) - { - // as expected - } - try - { - StringUtil.getFromUnicodeBE( test_data, 32, 16 ); - fail( "Should have caught ArrayIndexOutOfBoundsException" ); - } - catch ( ArrayIndexOutOfBoundsException ignored ) - { - // as expected - } - - try - { - StringUtil.getFromUnicodeBE( test_data, 1, 16 ); - fail( "Should have caught IllegalArgumentException" ); - } - catch ( IllegalArgumentException ignored ) - { - // as expected - } - - try - { - StringUtil.getFromUnicodeBE( test_data, 1, -1 ); - fail( "Should have caught IllegalArgumentException" ); - } - catch ( IllegalArgumentException ignored ) - { - // as expected - } - } /** * Test putCompressedUnicode |