Confusing behavior of cmopareToAscii overloads
Change-Id: If432b67cebdb9a009a015ddf046ed1ce15920e57
This commit is contained in:
@@ -39,8 +39,11 @@ class Compare: public CppUnit::TestFixture
|
|||||||
private:
|
private:
|
||||||
void equalsIgnoreAsciiCaseAscii();
|
void equalsIgnoreAsciiCaseAscii();
|
||||||
|
|
||||||
|
void compareToAscii();
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(Compare);
|
CPPUNIT_TEST_SUITE(Compare);
|
||||||
CPPUNIT_TEST(equalsIgnoreAsciiCaseAscii);
|
CPPUNIT_TEST(equalsIgnoreAsciiCaseAscii);
|
||||||
|
CPPUNIT_TEST(compareToAscii);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,4 +69,14 @@ void test::oustring::Compare::equalsIgnoreAsciiCaseAscii()
|
|||||||
equalsIgnoreAsciiCaseAscii("abcd"));
|
equalsIgnoreAsciiCaseAscii("abcd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test::oustring::Compare::compareToAscii()
|
||||||
|
{
|
||||||
|
// The different overloads of compareToAscii exhibit potentially confusing
|
||||||
|
// behavior:
|
||||||
|
rtl::OUString abc("abc");
|
||||||
|
CPPUNIT_ASSERT(abc.compareToAscii("a") > 0);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(
|
||||||
|
0, abc.compareToAscii(RTL_CONSTASCII_STRINGPARAM("a")));
|
||||||
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user