diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-13 16:16:20 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-13 16:21:05 +0100 |
commit | 01baa9e0c8df6a2c9e1a7d675ac6a2d7da7828cc (patch) | |
tree | 2be827fb79e518da12d196ac9e24a042764617c6 | |
parent | 3d9f5c856a4a77503695e68ce013ebf859fcb212 (diff) |
checked that we do not use OString ctor with literals with \0's
Except in some unittests, which are sometimes rather silly and
broken about it, which might explain why they're disabled.
-rw-r--r-- | sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 8 | ||||
-rw-r--r-- | sal/qa/rtl_strings/rtl_OString.cxx | 6 | ||||
-rw-r--r-- | sal/qa/rtl_strings/rtl_OUString.cxx | 10 | ||||
-rw-r--r-- | sal/qa/rtl_strings/rtl_OUStringBuffer.cxx | 24 |
4 files changed, 24 insertions, 24 deletions
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index e05c29358179..46b78144572d 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -190,7 +190,7 @@ namespace rtl_OStringBuffer arrOUS[2] = new OString( kTestStr25 ); arrOUS[3] = new OString( kTestStr27 ); arrOUS[4] = new OString( kTestStr29 ); - arrOUS[5] = new OString( "\0" ); + arrOUS[5] = new OString( "\0", 1 ); } @@ -395,7 +395,7 @@ namespace rtl_OStringBuffer arrOUS[1] = new OString( "1" ); arrOUS[2] = new OString( ); arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); + arrOUS[4] = new OString( "\0", 1 ); arrOUS[5] = new OString( kTestStr2 ); } @@ -528,7 +528,7 @@ namespace rtl_OStringBuffer arrOUS[1] = new OString( "1" ); arrOUS[2] = new OString( ); arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); + arrOUS[4] = new OString( "\0", 1 ); arrOUS[5] = new OString( kTestStr2 ); } @@ -992,7 +992,7 @@ namespace rtl_OStringBuffer arrOUS[1] = new OString( "1" ); arrOUS[2] = new OString( ); arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); + arrOUS[4] = new OString( "\0", 1 ); arrOUS[5] = new OString( kTestStr2 ); } diff --git a/sal/qa/rtl_strings/rtl_OString.cxx b/sal/qa/rtl_strings/rtl_OString.cxx index 935d420f13a8..5be8f3199f9d 100644 --- a/sal/qa/rtl_strings/rtl_OString.cxx +++ b/sal/qa/rtl_strings/rtl_OString.cxx @@ -356,11 +356,11 @@ TestCase arrTestCase[]={ new OString(kTestStr2)}, {"non empty and empty(def. constructor)", sal_False, new OString(kTestStr1),new OString()}, - {"two empty strings(string arg = '\\0')", sal_True, + {"two empty strings(string arg = \"\")", sal_True, new OString(""),new OString("")}, - {"empty(string arg = '\\0') and non empty", sal_False, + {"empty(string arg = \"\") and non empty", sal_False, new OString(""),new OString(kTestStr2)}, - {"non empty and empty(string arg = '\\0')", sal_False, + {"non empty and empty(string arg = \"\")", sal_False, new OString(kTestStr1),new OString("")} }; diff --git a/sal/qa/rtl_strings/rtl_OUString.cxx b/sal/qa/rtl_strings/rtl_OUString.cxx index 8b6552c5bd9b..dc1812e3d299 100644 --- a/sal/qa/rtl_strings/rtl_OUString.cxx +++ b/sal/qa/rtl_strings/rtl_OUString.cxx @@ -235,9 +235,9 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUString_getLength( 0, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString)}, - {"length of empty string (string arg = '\\0')", 0, + {"length of empty string (string arg = \"\\0\"')", 1, new OUString( "\0", - 0, + 1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString)} }; @@ -302,7 +302,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUString_equals( new OUString(aUStr1), new OUString() }, - {"two empty strings(string arg = '\\0')", sal_True, + {"two empty strings(string arg = \"\")", sal_True, new OUString( "", 0, kEncodingRTLTextUSASCII, @@ -312,14 +312,14 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUString_equals( kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString) }, - {"empty(string arg = '\\0') and non empty", sal_False, + {"empty(string arg = \"\") and non empty", sal_False, new OUString( "", 0, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), new OUString(aUStr2) }, - {"non empty and empty(string arg = '\\0')", sal_False, + {"non empty and empty(string arg = \"\")", sal_False, new OUString(aUStr1), new OUString( "", 0, diff --git a/sal/qa/rtl_strings/rtl_OUStringBuffer.cxx b/sal/qa/rtl_strings/rtl_OUStringBuffer.cxx index d690d613642d..7a9871c041e4 100644 --- a/sal/qa/rtl_strings/rtl_OUStringBuffer.cxx +++ b/sal/qa/rtl_strings/rtl_OUStringBuffer.cxx @@ -263,7 +263,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_makeStringAndCle OUString( aUStr25 ), OUString( aUStr27 ), OUString( aUStr29 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString) }; @@ -331,7 +331,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_getLength( OUString( "",0, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr2 )}; @@ -354,7 +354,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_getLength( new OUStringBuffer(arrOUS[2])}, {"length of empty string (empty ascii string arg)",0, new OUStringBuffer(arrOUS[3])}, - {"length of empty string (string arg = '\\0')", 0, + {"length of empty string (string arg = \"\\0\")", 1, new OUStringBuffer(arrOUS[4])}, {"length(>16) of ascii string", kTestStr2Len, new OUStringBuffer(arrOUS[5]) }, @@ -404,7 +404,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_getCapacity( OUString( "",0, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr2 )}; @@ -427,7 +427,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_getCapacity( new OUStringBuffer(arrOUS[2]) }, {"capacity of empty string (empty ascii string arg)",0+16, new OUStringBuffer(arrOUS[3]) }, - {"capacity of empty string (string arg = '\\0')", 0+16, + {"capacity of empty string (string arg = \"\\0\")", 1+16, new OUStringBuffer(arrOUS[4]) }, {"capacity(>16) of ascii string", kTestStr2Len+16, new OUStringBuffer(arrOUS[5]) }, @@ -564,7 +564,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUStringBuffer_setLength( OUString( "",0, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr2 )}; @@ -802,7 +802,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_append_001( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; @@ -919,7 +919,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_append_002( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; @@ -1036,7 +1036,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_append_003( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; @@ -1175,7 +1175,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_append_004( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; @@ -1276,7 +1276,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_appendAscii_001( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; @@ -1391,7 +1391,7 @@ sal_Bool SAL_CALL test_rtl_OUStringBuffer_appendAscii_002( OUString arrOUS[5]={OUString( aUStr7 ), OUString(), OUString( aUStr25 ), - OUString( "\0",0, + OUString( "\0",1, kEncodingRTLTextUSASCII, kConvertFlagsOStringToOUString), OUString( aUStr28 )}; |