summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-07-16 10:35:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-07-16 10:37:33 +0200
commit4ad006fc76b0f7fdd267c64fc868aaf63e281a31 (patch)
tree1876f97fe44bddc13bc304692423f6c371983003 /sal
parente35246c71ff08167e430d7e113cb139fe210e23c (diff)
Confusing behavior of cmopareToAscii overloads
Change-Id: If432b67cebdb9a009a015ddf046ed1ce15920e57
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/strings/test_oustring_compare.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sal/qa/rtl/strings/test_oustring_compare.cxx b/sal/qa/rtl/strings/test_oustring_compare.cxx
index fe97845a81ba..e8e4c91122f7 100644
--- a/sal/qa/rtl/strings/test_oustring_compare.cxx
+++ b/sal/qa/rtl/strings/test_oustring_compare.cxx
@@ -39,8 +39,11 @@ class Compare: public CppUnit::TestFixture
private:
void equalsIgnoreAsciiCaseAscii();
+ void compareToAscii();
+
CPPUNIT_TEST_SUITE(Compare);
CPPUNIT_TEST(equalsIgnoreAsciiCaseAscii);
+CPPUNIT_TEST(compareToAscii);
CPPUNIT_TEST_SUITE_END();
};
@@ -66,4 +69,14 @@ void test::oustring::Compare::equalsIgnoreAsciiCaseAscii()
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: */