summaryrefslogtreecommitdiff
path: root/sal/qa/rtl/oustring
diff options
context:
space:
mode:
authorGert Faller <gertfaller@aliceadsl.fr>2010-12-10 18:31:39 +0100
committerGert Faller <gertfaller@aliceadsl.fr>2010-12-10 18:31:39 +0100
commit3a18c3d97abfb60a09cc6a8bd5dd163fe2cfafa3 (patch)
tree02ef980b5d6440ebbacf6f8801bea9d27f62b7a5 /sal/qa/rtl/oustring
parent377a56fb1b9825ec5dc71ba9ae81b6e27cfabffb (diff)
RTL_CONSTASCII_USTRINGPARAM in ure 1
Diffstat (limited to 'sal/qa/rtl/oustring')
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx88
-rw-r--r--sal/qa/rtl/oustring/rtl_ustr.cxx170
2 files changed, 129 insertions, 129 deletions
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 4b05a027b57e..664b8b52fdea 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -59,7 +59,7 @@ namespace rtl_OUString
/// test of OUString(rtl_uString*)
void ctors_001()
{
- rtl::OUString *pStr = new rtl::OUString( rtl::OUString::createFromAscii("a String") );
+ rtl::OUString *pStr = new rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("a String") );
rtl::OUString aStrToTest(pStr->pData);
delete pStr;
@@ -69,7 +69,7 @@ namespace rtl_OUString
memset(pBuffer, 0, 2 * 8);
free(pBuffer);
- sal_Bool bResult = aStrToTest.equals(rtl::OUString::createFromAscii("a String"));
+ sal_Bool bResult = aStrToTest.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a String")));
CPPUNIT_ASSERT_MESSAGE("String must not be empty", bResult == sal_True);
}
@@ -692,88 +692,88 @@ public:
void lastIndexOf_test_oustring_offset_001()
{
// search for sun, start at the end, found (pos==0)
- rtl::OUString aStr = rtl::OUString::createFromAscii("sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring_offset(aStr, aSearchStr, 0, aStr.getLength());
}
void lastIndexOf_test_oustring_offset_002()
{
// search for sun, start at pos = 3, found (pos==0)
- rtl::OUString aStr = rtl::OUString::createFromAscii("sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring_offset(aStr, aSearchStr, 0, 3);
}
void lastIndexOf_test_oustring_offset_003()
{
// search for sun, start at pos = 2, found (pos==-1)
- rtl::OUString aStr = rtl::OUString::createFromAscii("sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring_offset(aStr, aSearchStr, -1, 2);
}
void lastIndexOf_test_oustring_offset_004()
{
// search for sun, start at the end, found (pos==0)
- rtl::OUString aStr = rtl::OUString::createFromAscii("sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring_offset(aStr, aSearchStr, -1, -1);
}
void lastIndexOf_test_oustring_001()
{
// search for sun, found (pos==0)
- rtl::OUString aStr = rtl::OUString::createFromAscii("sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, 0);
}
void lastIndexOf_test_oustring_002()
{
// search for sun, found (pos==4)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, 4);
}
void lastIndexOf_test_oustring_003()
{
// search for sun, found (pos==8)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, 8);
}
void lastIndexOf_test_oustring_004()
{
// search for sun, found (pos==8)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, 8);
}
void lastIndexOf_test_oustring_005()
{
// search for sun, found (pos==4)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun su");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun su"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, 4);
}
void lastIndexOf_test_oustring_006()
{
// search for sun, found (pos==-1)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the su su");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the su su"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("sun"));
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
void lastIndexOf_test_oustring_007()
{
// search for earth, not found (-1)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the su su");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("earth");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the su su"));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("earth"));
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
@@ -781,7 +781,7 @@ public:
{
// search for earth, not found (-1)
rtl::OUString aStr = rtl::OUString();
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("earth");
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("earth"));
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
@@ -797,7 +797,7 @@ public:
void lastIndexOf_test_salunicode_001()
{
// search for 's', found (19)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
sal_Unicode suChar = L's';
lastIndexOf_salunicode(aStr, suChar, 19);
}
@@ -805,7 +805,7 @@ public:
void lastIndexOf_test_salunicode_002()
{
// search for 'x', not found (-1)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
sal_Unicode suChar = L'x';
lastIndexOf_salunicode(aStr, suChar, -1);
}
@@ -813,21 +813,21 @@ public:
void lastIndexOf_test_salunicode_offset_001()
{
// search for 's', start from pos last char, found (19)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
sal_Unicode cuChar = L's';
lastIndexOf_salunicode_offset(aStr, cuChar, 19, aStr.getLength());
}
void lastIndexOf_test_salunicode_offset_002()
{
// search for 's', start pos is last occur from search behind, found (17)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
sal_Unicode cuChar = L's';
lastIndexOf_salunicode_offset(aStr, cuChar, 17, 19);
}
void lastIndexOf_test_salunicode_offset_003()
{
// search for 't', start pos is 1, found (0)
- rtl::OUString aStr = rtl::OUString::createFromAscii("the sun sun java system");
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("the sun sun java system"));
sal_Unicode cuChar = L't';
lastIndexOf_salunicode_offset(aStr, cuChar, 0, 1);
}
@@ -886,66 +886,66 @@ public:
void getToken_001()
{
- rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;b");
+ rtl::OUString suTokenStr(RTL_CONSTASCII_USTRINGPARAM("a;b"));
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString::createFromAscii("a")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, ';', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString::createFromAscii("b")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("b"))) == sal_True);
CPPUNIT_ASSERT_MESSAGE("index should be negative", nIndex == -1);
}
void getToken_002()
{
- rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;b.c");
+ rtl::OUString suTokenStr(RTL_CONSTASCII_USTRINGPARAM("a;b.c"));
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString::createFromAscii("a")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, '.', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString::createFromAscii("b")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("b"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, '.', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'c'", suToken.equals(rtl::OUString::createFromAscii("c")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'c'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("c"))) == sal_True);
CPPUNIT_ASSERT_MESSAGE("index should be negative", nIndex == -1);
}
void getToken_003()
{
- rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;;b");
+ rtl::OUString suTokenStr(RTL_CONSTASCII_USTRINGPARAM("a;;b"));
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString::createFromAscii("a")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'a'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, ';', nIndex );
CPPUNIT_ASSERT_MESSAGE("Token should be empty", suToken.getLength() == 0);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, ';', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString::createFromAscii("b")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be a 'b'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("b"))) == sal_True);
CPPUNIT_ASSERT_MESSAGE("index should be negative", nIndex == -1);
}
void getToken_004()
{
- rtl::OUString suTokenStr = rtl::OUString::createFromAscii("longer.then.ever.");
+ rtl::OUString suTokenStr(RTL_CONSTASCII_USTRINGPARAM("longer.then.ever."));
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, '.', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be 'longer'", suToken.equals(rtl::OUString::createFromAscii("longer")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be 'longer'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("longer"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, '.', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be 'then'", suToken.equals(rtl::OUString::createFromAscii("then")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be 'then'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("then"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, '.', nIndex );
- CPPUNIT_ASSERT_MESSAGE("Token should be 'ever'", suToken.equals(rtl::OUString::createFromAscii("ever")) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Token should be 'ever'", suToken.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ever"))) == sal_True);
/* rtl::OUString */ suToken = suTokenStr.getToken( 0, '.', nIndex );
CPPUNIT_ASSERT_MESSAGE("Token should be empty", suToken.getLength() == 0);
diff --git a/sal/qa/rtl/oustring/rtl_ustr.cxx b/sal/qa/rtl/oustring/rtl_ustr.cxx
index ccc161ec9b01..f0cd05c3e4f6 100644
--- a/sal/qa/rtl/oustring/rtl_ustr.cxx
+++ b/sal/qa/rtl/oustring/rtl_ustr.cxx
@@ -59,7 +59,7 @@ namespace rtl_ustr
void compare_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_compare( aStr1.getStr(), NULL);
// should not GPF
}
@@ -74,8 +74,8 @@ namespace rtl_ustr
void compare_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
sal_Int32 nValue = rtl_ustr_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal.", nValue == 0);
@@ -83,8 +83,8 @@ namespace rtl_ustr
void compare_003()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line foo bar, ok, differ.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line foo bar, ok, differ."));
sal_Int32 nValue = rtl_ustr_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
@@ -115,7 +115,7 @@ namespace rtl_ustr
void compare_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), NULL);
}
void compare_001()
@@ -129,8 +129,8 @@ namespace rtl_ustr
void compare_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
sal_Int32 nValue = rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal.", nValue == 0);
@@ -138,8 +138,8 @@ namespace rtl_ustr
void compare_002_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("LINE MUST BE EQUAL.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("LINE MUST BE EQUAL."));
sal_Int32 nValue = rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
@@ -147,8 +147,8 @@ namespace rtl_ustr
void compare_003()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line foo bar, ok, differ.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line foo bar, ok, differ."));
sal_Int32 nValue = rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
@@ -181,7 +181,7 @@ namespace rtl_ustr
void compare_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(), NULL, 0, 1);
}
void compare_001()
@@ -195,8 +195,8 @@ namespace rtl_ustr
void compare_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
sal_Int32 nValue = rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(),
aStr2.getStr(), aStr2.getLength(),
@@ -206,8 +206,8 @@ namespace rtl_ustr
void compare_002_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("LINE MUST BE EQUAL.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("LINE MUST BE EQUAL."));
sal_Int32 nValue = rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(),
aStr2.getStr(), aStr2.getLength(),
@@ -217,8 +217,8 @@ namespace rtl_ustr
void compare_003()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line foo bar, ok, differ.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line foo bar, ok, differ."));
sal_Int32 nValue = rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(),
aStr2.getStr(), aStr2.getLength(),
@@ -228,8 +228,8 @@ namespace rtl_ustr
void compare_004()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
- rtl::OUString aStr2 = rtl::OUString::createFromAscii("Line foo bar, ok, differ.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
+ rtl::OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("Line foo bar, ok, differ."));
sal_Int32 nValue = rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(),
aStr2.getStr(), aStr2.getLength(),
@@ -321,7 +321,7 @@ namespace rtl_ustr
void indexOfChar_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfChar.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a indexOfChar."));
sal_Int32 nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'L' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
@@ -338,7 +338,7 @@ namespace rtl_ustr
void indexOfChar_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfChar.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a indexOfChar."));
sal_Int32 nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'y' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
@@ -367,7 +367,7 @@ namespace rtl_ustr
void lastIndexOfChar_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfChar.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfChar."));
sal_Int32 nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'C' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 22);
@@ -384,7 +384,7 @@ namespace rtl_ustr
void lastIndexOfChar_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfChar.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfChar."));
sal_Int32 nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'y' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
@@ -415,35 +415,35 @@ namespace rtl_ustr
void indexOfStr_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfStr.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a indexOfStr."));
rtl_ustr_indexOfStr( aStr1.getStr(), 0 );
}
void indexOfStr_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfStr.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a indexOfStr."));
- rtl::OUString suSearch = rtl::OUString::createFromAscii("Line");
+ rtl::OUString suSearch(RTL_CONSTASCII_USTRINGPARAM("Line"));
sal_Int32 nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
- /* rtl::OUString */ suSearch = rtl::OUString::createFromAscii("for");
+ /* rtl::OUString */ suSearch(RTL_CONSTASCII_USTRINGPARAM("for"));
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 5);
- /* rtl::OUString */ suSearch = rtl::OUString::createFromAscii("a");
+ /* rtl::OUString */ suSearch(RTL_CONSTASCII_USTRINGPARAM("a"));
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 9);
- /* rtl::OUString */ suSearch = rtl::OUString::createFromAscii("a index");
+ /* rtl::OUString */ suSearch(RTL_CONSTASCII_USTRINGPARAM("a index"));
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex ==9);
}
void indexOfStr_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfStr.");
- rtl::OUString suSearch = rtl::OUString::createFromAscii("not exist");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a indexOfStr."));
+ rtl::OUString suSearch(RTL_CONSTASCII_USTRINGPARAM("not exist"));
sal_Int32 nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
@@ -473,31 +473,31 @@ namespace rtl_ustr
void lastIndexOfStr_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfStr."));
rtl_ustr_lastIndexOfStr( aStr1.getStr(), NULL );
}
void lastIndexOfStr_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("Index");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfStr."));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("Index"));
sal_Int32 nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 15);
- /* rtl::OString */ aSearchStr = rtl::OUString::createFromAscii("Line");
+ /* rtl::OString */ aSearchStr = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line"));
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
- /* rtl::OString */ aSearchStr = rtl::OUString::createFromAscii("");
+ /* rtl::OString */ aSearchStr = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(""));
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1);
}
void lastIndexOfStr_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("foo");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfStr."));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("foo"));
sal_Int32 nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
@@ -505,8 +505,8 @@ namespace rtl_ustr
void lastIndexOfStr_003()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
- rtl::OUString aSearchStr = rtl::OUString::createFromAscii("O");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line for a lastIndexOfStr."));
+ rtl::OUString aSearchStr(RTL_CONSTASCII_USTRINGPARAM("O"));
sal_Int32 nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 20 );
@@ -537,8 +537,8 @@ namespace rtl_ustr
void replaceChar_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("replace char.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("ruplacu char.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("replace char."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("ruplacu char."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc( nLength + sizeof(sal_Unicode)); // length + 1 (null terminator)
@@ -580,8 +580,8 @@ namespace rtl_ustr
}
void replaceChar_WithLength_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("replace char.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("ruplace char.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("replace char."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("ruplace char."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength);
@@ -597,8 +597,8 @@ namespace rtl_ustr
void replaceChar_WithLength_002()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("eeeeeeeeeeeee");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("uuuuuueeeeeee");
+ rtl::OUString aStr1 (RTL_CONSTASCII_USTRINGPARAM("eeeeeeeeeeeee"));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("uuuuuueeeeeee"));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength); // no null terminator is need
@@ -638,8 +638,8 @@ namespace rtl_ustr
void toAsciiLowerCase_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII LOWER CASE.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("change this to ascii lower case.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIS TO ASCII LOWER CASE."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("change this to ascii lower case."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode) ); // we need to add '\0' so one more
@@ -676,8 +676,8 @@ namespace rtl_ustr
void toAsciiLowerCase_WithLength_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII LOWER CASE.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("change thiS TO ASCII LOWER CASE.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIS TO ASCII LOWER CASE."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("change thiS TO ASCII LOWER CASE."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength);
@@ -720,8 +720,8 @@ namespace rtl_ustr
void toAsciiUpperCase_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("change this to ascii upper case."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIS TO ASCII UPPER CASE."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
@@ -758,8 +758,8 @@ namespace rtl_ustr
void toAsciiUpperCase_WithLength_001()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("change this to ascii lower case.");
- rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIs to ascii lower case.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("change this to ascii lower case."));
+ rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIs to ascii lower case."));
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength);
@@ -798,7 +798,7 @@ namespace rtl_ustr
void trim_WithLength_000_1()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM(" trim this"));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
@@ -810,7 +810,7 @@ namespace rtl_ustr
void trim_WithLength_001()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM(" trim this"));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
memcpy(pStr, suStr.getStr(), nLength);
@@ -824,7 +824,7 @@ namespace rtl_ustr
void trim_WithLength_002()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii("trim this");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM("trim this"));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
@@ -839,7 +839,7 @@ namespace rtl_ustr
void trim_WithLength_003()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM(" trim this"));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
@@ -853,7 +853,7 @@ namespace rtl_ustr
void trim_WithLength_004()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii("\r\n\t \n\r trim \n this");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM("\r\n\t \n\r trim \n this"));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
@@ -867,7 +867,7 @@ namespace rtl_ustr
void trim_WithLength_005()
{
- rtl::OUString suStr = rtl::OUString::createFromAscii("\r\n\t \n\r trim \t this \n\r\t\t ");
+ rtl::OUString suStr(RTL_CONSTASCII_USTRINGPARAM("\r\n\t \n\r trim \t this \n\r\t\t "));
sal_uInt32 nLength = suStr.getLength() * sizeof(sal_Unicode);
sal_Unicode *pStr = (sal_Unicode*)malloc(nLength);
@@ -1022,13 +1022,13 @@ namespace rtl_ustr
void ascii_shortenedCompareIgnoreAsciiCase_WithLength_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), aStr1.getLength(), NULL, 0);
// should not GPF
}
void ascii_shortenedCompareIgnoreAsciiCase_WithLength_000_2()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line is shorter.";
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( aStr1.getStr(), sStr2.getLength(), sStr2.getStr(), 0);
// should not GPF
@@ -1044,7 +1044,7 @@ namespace rtl_ustr
void ascii_shortenedCompareIgnoreAsciiCase_WithLength_002()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line must be equal.";
sal_Int32 nValue = rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( suStr1.getStr(), suStr1.getLength(), sStr2.getStr(), sStr2.getLength());
@@ -1053,7 +1053,7 @@ namespace rtl_ustr
void ascii_shortenedCompareIgnoreAsciiCase_WithLength_003()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
rtl::OString sStr2 = "Line must be differ and longer.";
sal_Int32 nValue = rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( suStr1.getStr(), suStr1.getLength(), sStr2.getStr(), sStr2.getLength());
@@ -1088,13 +1088,13 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_WithLength_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( aStr1.getStr(), 0, NULL);
// should not GPF
}
void ascii_compareIgnoreAsciiCase_WithLength_000_2()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line is shorter.";
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( aStr1.getStr(), sStr2.getLength(), sStr2.getStr());
// should not GPF
@@ -1110,7 +1110,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_WithLength_002()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line must be equal.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( suStr1.getStr(), suStr1.getLength(), sStr2.getStr());
@@ -1119,7 +1119,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_WithLength_003()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
rtl::OString sStr2 = "Line must be differ and longer.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( suStr1.getStr(), suStr1.getLength(), sStr2.getStr());
@@ -1154,7 +1154,7 @@ namespace rtl_ustr
void ascii_compare_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_ascii_compare( aStr1.getStr(), NULL);
// should not GPF
}
@@ -1169,7 +1169,7 @@ namespace rtl_ustr
void ascii_compare_002()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line must be equal.";
sal_Int32 nValue = rtl_ustr_ascii_compare( suStr1.getStr(), sStr2.getStr());
@@ -1178,7 +1178,7 @@ namespace rtl_ustr
void ascii_compare_003()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
rtl::OString sStr2 = "Line foo bar, ok, differ.";
sal_Int32 nValue = rtl_ustr_ascii_compare( suStr1.getStr(), sStr2.getStr());
@@ -1212,7 +1212,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_ascii_compareIgnoreAsciiCase( aStr1.getStr(), NULL);
// should not GPF
}
@@ -1227,7 +1227,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_002()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line must be equal.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1236,7 +1236,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_002_1()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal, when ignore case.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal, when ignore case."));
rtl::OString sStr2 = "LINE MUST BE EQUAL, WHEN IGNORE CASE.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1245,7 +1245,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_003()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
rtl::OString sStr2 = "Line foo bar, ok, differ.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1256,8 +1256,8 @@ namespace rtl_ustr
// void ascii_compareIgnoreAsciiCase_001()
// {
- // rtl::OUString suStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
- // rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
+ // rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("change this to ascii upper case."));
+ // rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIS TO ASCII UPPER CASE."));
//
// sal_uInt32 nLength = suStr1.getLength() * sizeof(sal_Unicode);
// sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
@@ -1310,7 +1310,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_000_1()
{
- rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl_ustr_ascii_compareIgnoreAsciiCase( aStr1.getStr(), NULL);
// should not GPF
}
@@ -1325,7 +1325,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_002()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal."));
rtl::OString sStr2 = "Line must be equal.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1334,7 +1334,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_002_1()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must be equal, when ignore case.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must be equal, when ignore case."));
rtl::OString sStr2 = "LINE MUST BE EQUAL, WHEN IGNORE CASE.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1343,7 +1343,7 @@ namespace rtl_ustr
void ascii_compareIgnoreAsciiCase_003()
{
- rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
+ rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("Line must differ."));
rtl::OString sStr2 = "Line foo bar, ok, differ.";
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
@@ -1354,8 +1354,8 @@ namespace rtl_ustr
// void ascii_compareIgnoreAsciiCase_001()
// {
- // rtl::OUString suStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
- // rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
+ // rtl::OUString suStr1(RTL_CONSTASCII_USTRINGPARAM("change this to ascii upper case."));
+ // rtl::OUString aShouldStr1(RTL_CONSTASCII_USTRINGPARAM("CHANGE THIS TO ASCII UPPER CASE."));
//
// sal_uInt32 nLength = suStr1.getLength() * sizeof(sal_Unicode);
// sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator