summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-03-19 09:22:44 +0100
committerThomas Arnhold <thomas@arnhold.org>2013-03-19 09:00:26 +0000
commit8b27d78b4afaa9c47ca0fda144c8060f2f14046b (patch)
tree2dbddceebf0f96492adc5652697e8efce8a8ba06 /sal/qa
parentfe8eba5faa59ddf9ee82f3eb009daac72a0ec846 (diff)
automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
Done with a perl regex: s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec Reviewed-on: https://gerrit.libreoffice.org/2832 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx4
-rw-r--r--sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx2
-rw-r--r--sal/qa/rtl/strings/test_oustring_compare.cxx10
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx8
-rw-r--r--sal/qa/rtl/uri/rtl_testuri.cxx31
5 files changed, 27 insertions, 28 deletions
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index 70e8107aa79b..c156c37b9393 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -54,7 +54,7 @@ public:
rtl_math_ConversionStatus status;
sal_Int32 end;
double res = rtl::math::stringToDouble(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +1.E01foo")),
+ rtl::OUString(" +1.E01foo"),
sal_Unicode('.'), sal_Unicode(','), &status, &end);
CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
CPPUNIT_ASSERT_EQUAL(sal_Int32(RTL_CONSTASCII_LENGTH(" +1.E01")), end);
@@ -65,7 +65,7 @@ public:
rtl_math_ConversionStatus status;
sal_Int32 end;
double res = rtl::math::stringToDouble(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +Efoo")),
+ rtl::OUString(" +Efoo"),
sal_Unicode('.'), sal_Unicode(','), &status, &end);
CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), end);
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
index a3afaef25849..70ed7548e4d9 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
@@ -40,7 +40,7 @@ private:
CPPUNIT_TEST_SUITE_REGISTRATION(test::oustringbuffer::ToString);
void test::oustringbuffer::ToString::testToString() {
- rtl::OUStringBuffer sb(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test string")));
+ rtl::OUStringBuffer sb(rtl::OUString("test string"));
rtl::OUString str = sb.toString();
CPPUNIT_ASSERT( str == "test string" );
// returned OUString must be independent from sb
diff --git a/sal/qa/rtl/strings/test_oustring_compare.cxx b/sal/qa/rtl/strings/test_oustring_compare.cxx
index 8b506b78d728..e3ad8dd9d4bf 100644
--- a/sal/qa/rtl/strings/test_oustring_compare.cxx
+++ b/sal/qa/rtl/strings/test_oustring_compare.cxx
@@ -50,16 +50,16 @@ void test::oustring::Compare::equalsIgnoreAsciiCaseAscii()
CPPUNIT_ASSERT(!rtl::OUString().equalsIgnoreAsciiCaseAscii("abc"));
CPPUNIT_ASSERT(!rtl::OUString().equalsIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("abc")));
- CPPUNIT_ASSERT(!rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")).
+ CPPUNIT_ASSERT(!rtl::OUString("abc").
equalsIgnoreAsciiCaseAscii(""));
- CPPUNIT_ASSERT(!rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")).
+ CPPUNIT_ASSERT(!rtl::OUString("abc").
equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("")));
- CPPUNIT_ASSERT(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")).
+ CPPUNIT_ASSERT(rtl::OUString("abc").
equalsIgnoreAsciiCaseAscii("abc"));
- CPPUNIT_ASSERT(!rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abcd")).
+ CPPUNIT_ASSERT(!rtl::OUString("abcd").
equalsIgnoreAsciiCaseAscii("abc"));
- CPPUNIT_ASSERT(!rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")).
+ CPPUNIT_ASSERT(!rtl::OUString("abc").
equalsIgnoreAsciiCaseAscii("abcd"));
}
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 873b5366f6a5..7dc8eb8ea25f 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -96,13 +96,13 @@ void test::oustring::StringLiterals::checkCtors()
CPPUNIT_ASSERT( VALID_CONVERSION( bad5[ 1 ] ));
// Check that contents are correct and equal to the case when RTL_CONSTASCII_USTRINGPARAM is used.
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( "" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( "ab" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ab" )));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "" ), rtl::OUString( "" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "ab" ), rtl::OUString( "ab" ));
#if 0
// Also check that embedded \0 is included.
// In fact, allowing this is probably just trouble, so this now asserts.
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( "\0" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\0" )));
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( "a\0b" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a\0b" )));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "\0" ), rtl::OUString( "\0" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "a\0b" ), rtl::OUString( "a\0b" ));
#endif
}
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index ec29c8097d27..005a7a75388a 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -246,7 +246,7 @@ void Test::test_Uri() {
// Check UTF-8 handling:
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%E0%83%BF"));
+ aText1 = rtl::OUString("%E0%83%BF");
// \U+00FF encoded with three instead of two bytes
aText2 = aText1;
CPPUNIT_ASSERT_MESSAGE(
@@ -256,7 +256,7 @@ void Test::test_Uri() {
RTL_TEXTENCODING_UTF8)
== aText2));
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%EF%BF%BF"));
+ aText1 = rtl::OUString("%EF%BF%BF");
// \U+FFFF is no legal character
aText2 = aText1;
CPPUNIT_ASSERT_MESSAGE(
@@ -268,7 +268,7 @@ void Test::test_Uri() {
// Check IURI handling:
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%30%C3%BF"));
+ aText1 = rtl::OUString("%30%C3%BF");
aBuffer.appendAscii(RTL_CONSTASCII_STRINGPARAM("%30"));
aBuffer.append(static_cast< sal_Unicode >(0x00FF));
aText2 = aBuffer.makeStringAndClear();
@@ -279,8 +279,8 @@ void Test::test_Uri() {
// Check modified rtl_UriCharClassUnoParamValue (removed '[' and ']'):
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]%5B%5D"));
- aText2 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%5B%5D%5B%5D"));
+ aText1 = rtl::OUString("[]%5B%5D");
+ aText2 = rtl::OUString("%5B%5D%5B%5D");
CPPUNIT_ASSERT_MESSAGE(
"failure 19",
(rtl::Uri::encode(
@@ -381,7 +381,7 @@ void Test::test_Uri() {
{
sal_Unicode const aText1U[] = { ' ', '!', 0x0401, 0x045F, 0 };
aText1 = rtl::OUString(aText1U);
- aText2 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%20!%A1%FF"));
+ aText2 = rtl::OUString("%20!%A1%FF");
CPPUNIT_ASSERT_MESSAGE(
"failure 20",
(rtl::Uri::encode(
@@ -415,8 +415,7 @@ void Test::test_Uri() {
{
sal_Unicode const aText1U[] = { ' ', '!', 0x028A, 0xD849, 0xDD13, 0 };
aText1 = rtl::OUString(aText1U);
- aText2 = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("%20!%81%30%B1%33%95%39%C5%37"));
+ aText2 = rtl::OUString("%20!%81%30%B1%33%95%39%C5%37");
CPPUNIT_ASSERT_MESSAGE(
"failure 22",
(rtl::Uri::encode(
@@ -444,7 +443,7 @@ void Test::test_Uri() {
== aText2));
}
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%20%C4%80%FF"));
+ aText1 = rtl::OUString("%20%C4%80%FF");
aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE(
"failure 24",
@@ -453,7 +452,7 @@ void Test::test_Uri() {
== aText2));
}
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%81 "));
+ aText1 = rtl::OUString("%81 ");
aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE(
"failure 25",
@@ -462,7 +461,7 @@ void Test::test_Uri() {
== aText2));
}
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%81%20"));
+ aText1 = rtl::OUString("%81%20");
aText2 = rtl::OUString();
CPPUNIT_ASSERT_MESSAGE(
"failure 26",
@@ -471,7 +470,7 @@ void Test::test_Uri() {
== aText2));
}
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%81%30%B1%33"));
+ aText1 = rtl::OUString("%81%30%B1%33");
sal_Unicode const aText2U[] = { 0x028A, 0 };
aText2 = rtl::OUString(aText2U);
CPPUNIT_ASSERT_MESSAGE(
@@ -481,7 +480,7 @@ void Test::test_Uri() {
== aText2));
}
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%810%B13"));
+ aText1 = rtl::OUString("%810%B13");
sal_Unicode const aText2U[] = { 0x028A, 0 };
aText2 = rtl::OUString(aText2U);
CPPUNIT_ASSERT_MESSAGE(
@@ -494,8 +493,8 @@ void Test::test_Uri() {
// Check rtl_UriEncodeStrictKeepEscapes mode:
{
- aText1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%%ea%c3%aa"));
- aText2 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%25%EA%C3%AA"));
+ aText1 = rtl::OUString("%%ea%c3%aa");
+ aText2 = rtl::OUString("%25%EA%C3%AA");
CPPUNIT_ASSERT_MESSAGE(
"failure 29",
(rtl::Uri::encode(
@@ -506,7 +505,7 @@ void Test::test_Uri() {
{
sal_Unicode const aText1U[] = { 0x00EA, 0 };
aText1 = rtl::OUString(aText1U);
- aText2 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%C3%AA"));
+ aText2 = rtl::OUString("%C3%AA");
CPPUNIT_ASSERT_MESSAGE(
"failure 30",
(rtl::Uri::encode(