diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-04-06 19:49:53 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-04-06 20:03:42 +0200 |
commit | d6bc02f8c4cd0f50f0a2631ac7634dab408efc1f (patch) | |
tree | b5a12df1fcae025715633469b75ab4c9b6f6d279 /sal | |
parent | 0e1c0587617e0a6e4295a13599e97cdf6d1d2ea9 (diff) |
Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Diffstat (limited to 'sal')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx | 26 | ||||
-rw-r--r-- | sal/qa/rtl/oustring/rtl_OUString2.cxx | 4 | ||||
-rw-r--r-- | sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx | 6 | ||||
-rw-r--r-- | sal/rtl/source/bootstrap.cxx | 6 |
5 files changed, 14 insertions, 30 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index 40ad28cdea85..ba21dacef325 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -188,7 +188,7 @@ SAL_IMPLEMENT_MAIN() { while (index < rtl_getAppCommandArgCount()) { rtl::OUString arg = getArgument(index); - if (!arg.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("--protector"))) + if ( arg != "--protector" ) { if (testlib.empty()) { diff --git a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx index b25fb1612f37..71aa8da979b2 100644 --- a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx +++ b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx @@ -678,18 +678,13 @@ namespace rtl_Bootstrap void testRecursion() { rtl::OUString t(RTL_CONSTASCII_USTRINGPARAM("$RECURSIVE")); Bootstrap(t_getSourcePath(TESTSHL2_INI)).expandMacrosFrom(t); - CPPUNIT_ASSERT_MESSAGE( - "recursion detection", - t.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("***RECURSION DETECTED***"))); + CPPUNIT_ASSERT_MESSAGE( "recursion detection", t == "***RECURSION DETECTED***" ); } void testLink() { rtl::OUString t(RTL_CONSTASCII_USTRINGPARAM("$LINKED")); Bootstrap(t_getSourcePath(TESTSHL2_INI)).expandMacrosFrom(t); - CPPUNIT_ASSERT_MESSAGE( - "link file", - t.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("qadev17"))); + CPPUNIT_ASSERT_MESSAGE( "link file", t == "qadev17"); } void testOverride() { @@ -697,16 +692,12 @@ namespace rtl_Bootstrap RTL_CONSTASCII_USTRINGPARAM( "${.override:$ORIGIN/" SAL_CONFIGFILE("rtl") ":ORIGIN}")); Bootstrap(t_getSourcePath("rtl")).expandMacrosFrom(t1); - CPPUNIT_ASSERT_MESSAGE( - "override ORIGIN", - t1.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("direct"))); + CPPUNIT_ASSERT_MESSAGE( "override ORIGIN", t1 == "direct" ); rtl::OUString t2( RTL_CONSTASCII_USTRINGPARAM( "${.override:$ORIGIN/" SAL_CONFIGFILE("none") ":MYVAR}")); Bootstrap::expandMacros(t2); - CPPUNIT_ASSERT_MESSAGE( - "override MYVAR", - t2.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("src680_test"))); + CPPUNIT_ASSERT_MESSAGE( "override MYVAR", t2 == "src680_test" ); } void testNonexisting() { @@ -714,9 +705,7 @@ namespace rtl_Bootstrap RTL_CONSTASCII_USTRINGPARAM( "${$ORIGIN/" SAL_CONFIGFILE("none") ":MYVAR}")); Bootstrap::expandMacros(t); - CPPUNIT_ASSERT_MESSAGE( - "nonexisting", - t.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("src680_test"))); + CPPUNIT_ASSERT_MESSAGE( "nonexisting", t == "src680_test" ); } void testSection() { @@ -732,10 +721,7 @@ namespace rtl_Bootstrap b.appendAscii(RTL_CONSTASCII_STRINGPARAM(":Other_Section:EXPAND}")); rtl::OUString t(b.makeStringAndClear()); Bootstrap(t_getSourcePath(TESTSHL2_INI)).expandMacrosFrom(t); - CPPUNIT_ASSERT_MESSAGE( - "section expansion", - t.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("$FILE"))); + CPPUNIT_ASSERT_MESSAGE( "section expansion", t == "$FILE" ); // the correct answer would be "testshl2 file" instead, but // expansion including a section currently erroneously does not // recursively expand macros in the resulting replacement text diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx index 5d4953e040f3..37711cf0dad4 100644 --- a/sal/qa/rtl/oustring/rtl_OUString2.cxx +++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx @@ -1022,7 +1022,7 @@ public: ::rtl::OUString aFoo( RTL_CONSTASCII_USTRINGPARAM("foo") ); ::rtl::OUString aFooIntern = aFoo.intern(); - CPPUNIT_ASSERT_MESSAGE("string contents", aFooIntern.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("foo"))); + CPPUNIT_ASSERT_MESSAGE( "string contents", aFooIntern == "foo" ); CPPUNIT_ASSERT_MESSAGE("string length", aFooIntern.getLength() == 3); // We have to dup due to no atomic 'intern' bit-set operation CPPUNIT_ASSERT_MESSAGE("intern dups", aFoo.pData != aFooIntern.pData); @@ -1246,7 +1246,7 @@ void convertFromString::test() { (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))); - CPPUNIT_ASSERT(t.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("abc"))); + CPPUNIT_ASSERT( t == "abc" ); } // ----------------------------------------------------------------------------- diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx index 454bba9254c6..ae402bb0d911 100644 --- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx +++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx @@ -53,12 +53,12 @@ CPPUNIT_TEST_SUITE_REGISTRATION(test::oustringbuffer::ToString); void test::oustringbuffer::ToString::testToString() { rtl::OUStringBuffer sb(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test string"))); rtl::OUString str = sb.toString(); - CPPUNIT_ASSERT(str.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("test string"))); + CPPUNIT_ASSERT( str == "test string" ); // returned OUString must be independent from sb sb.append( (sal_Unicode)'a' ); - CPPUNIT_ASSERT(str.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("test string"))); + CPPUNIT_ASSERT( str == "test string" ); sb.setLength(0); - CPPUNIT_ASSERT(str.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("test string"))); + CPPUNIT_ASSERT( str == "test string" ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 0869366e5660..1d3f05209add 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -810,8 +810,7 @@ rtl::OUString expandMacros( if (n == 1) { buf.append(lookup(file, mode, false, seg[0], requestStack)); } else if (n == 2) { - if (seg[0].equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM(".link"))) + if ( seg[0] == ".link" ) { osl::File f(seg[1]); rtl::ByteSequence seq; @@ -843,8 +842,7 @@ rtl::OUString expandMacros( rtl::Bootstrap(seg[0]).getHandle()), mode, false, seg[1], requestStack)); } - } else if (seg[0].equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM(".override"))) + } else if ( seg[0] == ".override" ) { rtl::Bootstrap b(seg[1]); Bootstrap_Impl * f = static_cast< Bootstrap_Impl * >( |