diff options
Diffstat (limited to 'sal/qa/rtl/strings/test_strings_replace.cxx')
-rw-r--r-- | sal/qa/rtl/strings/test_strings_replace.cxx | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/sal/qa/rtl/strings/test_strings_replace.cxx b/sal/qa/rtl/strings/test_strings_replace.cxx index 40c0117e5c66..a27f5f14286b 100644 --- a/sal/qa/rtl/strings/test_strings_replace.cxx +++ b/sal/qa/rtl/strings/test_strings_replace.cxx @@ -66,175 +66,175 @@ private: void Test::stringReplaceFirst() { CPPUNIT_ASSERT_EQUAL( - rtl::OString("otherbarfoo"), - rtl::OString("foobarfoo").replaceFirst("foo", "other")); + OString("otherbarfoo"), + OString("foobarfoo").replaceFirst("foo", "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OString("foobarfoo"), - rtl::OString("foobarfoo").replaceFirst("bars", "other")); + OString("foobarfoo"), + OString("foobarfoo").replaceFirst("bars", "other")); { sal_Int32 n = 0; CPPUNIT_ASSERT_EQUAL( - rtl::OString("otherbarfoo"), - rtl::OString("foobarfoo").replaceFirst("foo", "other", &n)); + OString("otherbarfoo"), + OString("foobarfoo").replaceFirst("foo", "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), n); } { sal_Int32 n = 1; CPPUNIT_ASSERT_EQUAL( - rtl::OString("foobarother"), - rtl::OString("foobarfoo").replaceFirst("foo", "other", &n)); + OString("foobarother"), + OString("foobarfoo").replaceFirst("foo", "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), n); } { sal_Int32 n = 4; CPPUNIT_ASSERT_EQUAL( - rtl::OString("foobarfoo"), - rtl::OString("foobarfoo").replaceFirst("bar", "other", &n)); + OString("foobarfoo"), + OString("foobarfoo").replaceFirst("bar", "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), n); } } void Test::stringReplaceAll() { CPPUNIT_ASSERT_EQUAL( - rtl::OString("otherbarother"), - rtl::OString("foobarfoo").replaceAll("foo", "other")); + OString("otherbarother"), + OString("foobarfoo").replaceAll("foo", "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OString("foobarfoo"), - rtl::OString("foobarfoo").replaceAll("bars", "other")); + OString("foobarfoo"), + OString("foobarfoo").replaceAll("bars", "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OString("xxa"), rtl::OString("xaa").replaceAll("xa", "xx")); + OString("xxa"), OString("xaa").replaceAll("xa", "xx")); } void Test::ustringReplaceFirst() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, s_other)); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst(s_foo, s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_bars, s_other)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst(s_bars, s_other)); { sal_Int32 n = 0; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, s_other, &n)); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst(s_foo, s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), n); } { sal_Int32 n = 1; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarother"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, s_other, &n)); + OUString("foobarother"), + OUString("foobarfoo").replaceFirst(s_foo, s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), n); } { sal_Int32 n = 4; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_bar, s_other, &n)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst(s_bar, s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), n); } } void Test::ustringReplaceFirstAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst("foo", s_other)); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst("foo", s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst("bars", s_other)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst("bars", s_other)); { sal_Int32 n = 0; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst("foo", s_other, &n)); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst("foo", s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), n); } { sal_Int32 n = 1; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarother"), - rtl::OUString("foobarfoo").replaceFirst("foo", s_other, &n)); + OUString("foobarother"), + OUString("foobarfoo").replaceFirst("foo", s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), n); } { sal_Int32 n = 4; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst("bar", s_other, &n)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst("bar", s_other, &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), n); } CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceFirst("xa", s_empty)); + OUString(), OUString("xa").replaceFirst("xa", s_empty)); } void Test::ustringReplaceFirstToAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, "other")); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst(s_foo, "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_bars, "other")); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst(s_bars, "other")); { sal_Int32 n = 0; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, "other", &n)); + OUString("otherbarfoo"), + OUString("foobarfoo").replaceFirst(s_foo, "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), n); } { sal_Int32 n = 1; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarother"), - rtl::OUString("foobarfoo").replaceFirst(s_foo, "other", &n)); + OUString("foobarother"), + OUString("foobarfoo").replaceFirst(s_foo, "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), n); } { sal_Int32 n = 4; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceFirst(s_bar, "other", &n)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceFirst(s_bar, "other", &n)); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), n); } CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceFirst(s_xa, "")); + OUString(), OUString("xa").replaceFirst(s_xa, "")); } void Test::ustringReplaceFirstAsciiLAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - (rtl::OUString("foobarfoo"). + OUString("otherbarfoo"), + (OUString("foobarfoo"). replaceFirst("foo", "other"))); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - (rtl::OUString("foobarfoo"). + OUString("foobarfoo"), + (OUString("foobarfoo"). replaceFirst("bars", "other"))); { sal_Int32 n = 0; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarfoo"), - (rtl::OUString("foobarfoo"). + OUString("otherbarfoo"), + (OUString("foobarfoo"). replaceFirst("foo", "other", &n))); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), n); } @@ -242,8 +242,8 @@ void Test::ustringReplaceFirstAsciiLAsciiL() { { sal_Int32 n = 1; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarother"), - (rtl::OUString("foobarfoo"). + OUString("foobarother"), + (OUString("foobarfoo"). replaceFirst("foo", "other", &n))); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), n); } @@ -251,82 +251,82 @@ void Test::ustringReplaceFirstAsciiLAsciiL() { { sal_Int32 n = 4; CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - (rtl::OUString("foobarfoo"). + OUString("foobarfoo"), + (OUString("foobarfoo"). replaceFirst("bar", "other", &n))); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), n); } CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceFirst("xa", "")); + OUString(), OUString("xa").replaceFirst("xa", "")); } void Test::ustringReplaceAll() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarother"), - rtl::OUString("foobarfoo").replaceAll(s_foo, s_other)); + OUString("otherbarother"), + OUString("foobarfoo").replaceAll(s_foo, s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceAll(s_bars, s_other)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceAll(s_bars, s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("xxa"), - rtl::OUString("xaa").replaceAll(s_xa, s_xx)); + OUString("xxa"), + OUString("xaa").replaceAll(s_xa, s_xx)); } void Test::ustringReplaceAllAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarother"), - rtl::OUString("foobarfoo").replaceAll("foo", s_other)); + OUString("otherbarother"), + OUString("foobarfoo").replaceAll("foo", s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceAll("bars", s_other)); + OUString("foobarfoo"), + OUString("foobarfoo").replaceAll("bars", s_other)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("xxa"), - rtl::OUString("xaa").replaceAll("xa", s_xx)); + OUString("xxa"), + OUString("xaa").replaceAll("xa", s_xx)); CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceAll("xa", s_empty)); + OUString(), OUString("xa").replaceAll("xa", s_empty)); } void Test::ustringReplaceAllToAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarother"), - rtl::OUString("foobarfoo").replaceAll(s_foo, "other")); + OUString("otherbarother"), + OUString("foobarfoo").replaceAll(s_foo, "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - rtl::OUString("foobarfoo").replaceAll(s_bars, "other")); + OUString("foobarfoo"), + OUString("foobarfoo").replaceAll(s_bars, "other")); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("xxa"), - rtl::OUString("xaa").replaceAll(s_xa, "xx")); + OUString("xxa"), + OUString("xaa").replaceAll(s_xa, "xx")); CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceAll(s_xa, "")); + OUString(), OUString("xa").replaceAll(s_xa, "")); } void Test::ustringReplaceAllAsciiLAsciiL() { CPPUNIT_ASSERT_EQUAL( - rtl::OUString("otherbarother"), - (rtl::OUString("foobarfoo"). + OUString("otherbarother"), + (OUString("foobarfoo"). replaceAll("foo", "other"))); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("foobarfoo"), - (rtl::OUString("foobarfoo"). + OUString("foobarfoo"), + (OUString("foobarfoo"). replaceAll("bars", "other"))); CPPUNIT_ASSERT_EQUAL( - rtl::OUString("xxa"), - (rtl::OUString("xaa"). + OUString("xxa"), + (OUString("xaa"). replaceAll("xa", "xx"))); CPPUNIT_ASSERT_EQUAL( - rtl::OUString(), rtl::OUString("xa").replaceAll("xa", "")); + OUString(), OUString("xa").replaceAll("xa", "")); } } |