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.
This commit is contained in:
Luboš Luňák 2012-03-13 16:16:20 +01:00
parent 3d9f5c856a
commit 01baa9e0c8
4 changed files with 24 additions and 24 deletions

View file

@ -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 );
}

View file

@ -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("")}
};

View file

@ -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,

View file

@ -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 )};