Kaydet (Commit) 9b03a827 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

sal: Use appropriate OUString functions on string constants

Change-Id: I4382504549eb1e3a8c34495a21d6df10a86ac23b
üst 7fbdb69c
...@@ -572,9 +572,9 @@ namespace osl_FileBase ...@@ -572,9 +572,9 @@ namespace osl_FileBase
void getAbsoluteFileURL::getAbsoluteFileURL_004() void getAbsoluteFileURL::getAbsoluteFileURL_004()
{ {
//create two level directories under $Temp/PID/ //create two level directories under $Temp/PID/
::rtl::OUString aUStrUpBase = aUserDirectoryURL + ::rtl::OUString("/test1"); ::rtl::OUString aUStrUpBase = aUserDirectoryURL + "/test1";
createTestDirectory( aUStrUpBase ); createTestDirectory( aUStrUpBase );
::rtl::OUString aUStrBase = aUserDirectoryURL + ::rtl::OUString("/test1/dir1"); ::rtl::OUString aUStrBase = aUserDirectoryURL + "/test1/dir1";
createTestDirectory( aUStrBase ); createTestDirectory( aUStrBase );
::rtl::OUString suAssume = aUserDirectoryURL.concat( ::rtl::OUString("/mytestfile") ); ::rtl::OUString suAssume = aUserDirectoryURL.concat( ::rtl::OUString("/mytestfile") );
......
...@@ -439,9 +439,9 @@ public: ...@@ -439,9 +439,9 @@ public:
{ {
oslProcess process; oslProcess process;
#if defined(WNT) #if defined(WNT)
rtl::OUString suBatch = suCWD + rtl::OUString("/") + rtl::OUString("batch.bat"); rtl::OUString suBatch = suCWD + "/batch.bat";
#else #else
rtl::OUString suBatch = suCWD + rtl::OUString("/") + rtl::OUString("batch.sh"); rtl::OUString suBatch = suCWD + "/batch.sh";
#endif #endif
oslProcessError osl_error = osl_executeProcess( oslProcessError osl_error = osl_executeProcess(
suBatch.pData, suBatch.pData,
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
:m_nOK(0), :m_nOK(0),
m_nFails(0) m_nFails(0)
{ {
m_sConstStr = rtl::OUString( CONST_TEST_STRING ); m_sConstStr = CONST_TEST_STRING;
} }
sal_Int32 getOK() { return m_nOK; } sal_Int32 getOK() { return m_nOK; }
......
...@@ -188,8 +188,7 @@ void Test::test_Uri() { ...@@ -188,8 +188,7 @@ void Test::test_Uri() {
aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); // %ED%BF%BF aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); // %ED%BF%BF
aBuffer.append('A'); // A aBuffer.append('A'); // A
aText1 = aBuffer.makeStringAndClear(); aText1 = aBuffer.makeStringAndClear();
aText2 = rtl::OUString( aText2 = "%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A";
"%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A");
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 11", "failure 11",
(rtl::Uri::encode( (rtl::Uri::encode(
...@@ -209,8 +208,7 @@ void Test::test_Uri() { ...@@ -209,8 +208,7 @@ void Test::test_Uri() {
RTL_TEXTENCODING_UTF8) RTL_TEXTENCODING_UTF8)
== aText2)); == aText2));
aText1 = rtl::OUString( aText1 = "%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A";
"%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A");
aBuffer.append("%ED%A0%80"); aBuffer.append("%ED%A0%80");
aBuffer.append(static_cast< sal_Unicode >(0xD800)); aBuffer.append(static_cast< sal_Unicode >(0xD800));
aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); aBuffer.append(static_cast< sal_Unicode >(0xDFFF));
...@@ -229,7 +227,7 @@ void Test::test_Uri() { ...@@ -229,7 +227,7 @@ void Test::test_Uri() {
// Check UTF-8 handling: // Check UTF-8 handling:
aText1 = rtl::OUString("%E0%83%BF"); aText1 = "%E0%83%BF";
// \U+00FF encoded with three instead of two bytes // \U+00FF encoded with three instead of two bytes
aText2 = aText1; aText2 = aText1;
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
...@@ -239,7 +237,7 @@ void Test::test_Uri() { ...@@ -239,7 +237,7 @@ void Test::test_Uri() {
RTL_TEXTENCODING_UTF8) RTL_TEXTENCODING_UTF8)
== aText2)); == aText2));
aText1 = rtl::OUString("%EF%BF%BF"); aText1 = "%EF%BF%BF";
// \U+FFFF is no legal character // \U+FFFF is no legal character
aText2 = aText1; aText2 = aText1;
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
...@@ -251,7 +249,7 @@ void Test::test_Uri() { ...@@ -251,7 +249,7 @@ void Test::test_Uri() {
// Check IURI handling: // Check IURI handling:
aText1 = rtl::OUString("%30%C3%BF"); aText1 = "%30%C3%BF";
aBuffer.append("%30"); aBuffer.append("%30");
aBuffer.append(static_cast< sal_Unicode >(0x00FF)); aBuffer.append(static_cast< sal_Unicode >(0x00FF));
aText2 = aBuffer.makeStringAndClear(); aText2 = aBuffer.makeStringAndClear();
...@@ -262,8 +260,8 @@ void Test::test_Uri() { ...@@ -262,8 +260,8 @@ void Test::test_Uri() {
// Check modified rtl_UriCharClassUnoParamValue (removed '[' and ']'): // Check modified rtl_UriCharClassUnoParamValue (removed '[' and ']'):
aText1 = rtl::OUString("[]%5B%5D"); aText1 = "[]%5B%5D";
aText2 = rtl::OUString("%5B%5D%5B%5D"); aText2 = "%5B%5D%5B%5D";
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 19", "failure 19",
(rtl::Uri::encode( (rtl::Uri::encode(
...@@ -367,7 +365,7 @@ void Test::test_Uri() { ...@@ -367,7 +365,7 @@ void Test::test_Uri() {
{ {
sal_Unicode const aText1U[] = { ' ', '!', 0x0401, 0x045F, 0 }; sal_Unicode const aText1U[] = { ' ', '!', 0x0401, 0x045F, 0 };
aText1 = rtl::OUString(aText1U); aText1 = rtl::OUString(aText1U);
aText2 = rtl::OUString("%20!%A1%FF"); aText2 = "%20!%A1%FF";
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 20", "failure 20",
(rtl::Uri::encode( (rtl::Uri::encode(
...@@ -402,7 +400,7 @@ void Test::test_Uri() { ...@@ -402,7 +400,7 @@ void Test::test_Uri() {
{ {
sal_Unicode const aText1U[] = { ' ', '!', 0x028A, 0xD849, 0xDD13, 0 }; sal_Unicode const aText1U[] = { ' ', '!', 0x028A, 0xD849, 0xDD13, 0 };
aText1 = rtl::OUString(aText1U); aText1 = rtl::OUString(aText1U);
aText2 = rtl::OUString("%20!%81%30%B1%33%95%39%C5%37"); aText2 = "%20!%81%30%B1%33%95%39%C5%37";
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 22", "failure 22",
(rtl::Uri::encode( (rtl::Uri::encode(
...@@ -430,7 +428,7 @@ void Test::test_Uri() { ...@@ -430,7 +428,7 @@ void Test::test_Uri() {
== aText2)); == aText2));
} }
{ {
aText1 = rtl::OUString("%20%C4%80%FF"); aText1 = "%20%C4%80%FF";
aText2 = rtl::OUString(); aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 24", "failure 24",
...@@ -440,7 +438,7 @@ void Test::test_Uri() { ...@@ -440,7 +438,7 @@ void Test::test_Uri() {
} }
#if WITH_LOCALE_ALL || WITH_LOCALE_zh #if WITH_LOCALE_ALL || WITH_LOCALE_zh
{ {
aText1 = rtl::OUString("%81 "); aText1 = "%81 ";
aText2 = rtl::OUString(); aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 25", "failure 25",
...@@ -449,7 +447,7 @@ void Test::test_Uri() { ...@@ -449,7 +447,7 @@ void Test::test_Uri() {
== aText2)); == aText2));
} }
{ {
aText1 = rtl::OUString("%81%20"); aText1 = "%81%20";
aText2 = rtl::OUString(); aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 26", "failure 26",
...@@ -458,7 +456,7 @@ void Test::test_Uri() { ...@@ -458,7 +456,7 @@ void Test::test_Uri() {
== aText2)); == aText2));
} }
{ {
aText1 = rtl::OUString("%81%30%B1%33"); aText1 = "%81%30%B1%33";
sal_Unicode const aText2U[] = { 0x028A, 0 }; sal_Unicode const aText2U[] = { 0x028A, 0 };
aText2 = rtl::OUString(aText2U); aText2 = rtl::OUString(aText2U);
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
...@@ -468,7 +466,7 @@ void Test::test_Uri() { ...@@ -468,7 +466,7 @@ void Test::test_Uri() {
== aText2)); == aText2));
} }
{ {
aText1 = rtl::OUString("%810%B13"); aText1 = "%810%B13";
sal_Unicode const aText2U[] = { 0x028A, 0 }; sal_Unicode const aText2U[] = { 0x028A, 0 };
aText2 = rtl::OUString(aText2U); aText2 = rtl::OUString(aText2U);
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
...@@ -481,8 +479,8 @@ void Test::test_Uri() { ...@@ -481,8 +479,8 @@ void Test::test_Uri() {
// Check rtl_UriEncodeStrictKeepEscapes mode: // Check rtl_UriEncodeStrictKeepEscapes mode:
{ {
aText1 = rtl::OUString("%%ea%c3%aa"); aText1 = "%%ea%c3%aa";
aText2 = rtl::OUString("%25%EA%C3%AA"); aText2 = "%25%EA%C3%AA";
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 29", "failure 29",
(rtl::Uri::encode( (rtl::Uri::encode(
...@@ -493,7 +491,7 @@ void Test::test_Uri() { ...@@ -493,7 +491,7 @@ void Test::test_Uri() {
{ {
sal_Unicode const aText1U[] = { 0x00EA, 0 }; sal_Unicode const aText1U[] = { 0x00EA, 0 };
aText1 = rtl::OUString(aText1U); aText1 = rtl::OUString(aText1U);
aText2 = rtl::OUString("%C3%AA"); aText2 = "%C3%AA";
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"failure 30", "failure 30",
(rtl::Uri::encode( (rtl::Uri::encode(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment