diff options
Diffstat (limited to 'comphelper/qa/string/test_string.cxx')
-rw-r--r-- | comphelper/qa/string/test_string.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 96706ace353d..96dcebd3c98f 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -54,6 +54,7 @@ public: void testDecimalStringToNumber(); void testIsdigitAsciiString(); void testReverseString(); + void testEqualsString(); CPPUNIT_TEST_SUITE(TestString); CPPUNIT_TEST(testNatural); @@ -66,6 +67,7 @@ public: CPPUNIT_TEST(testDecimalStringToNumber); CPPUNIT_TEST(testIsdigitAsciiString); CPPUNIT_TEST(testReverseString); + CPPUNIT_TEST(testEqualsString); CPPUNIT_TEST_SUITE_END(); }; @@ -405,6 +407,17 @@ void TestString::testReverseString() CPPUNIT_ASSERT(aOut == "CBA"); } +void TestString::testEqualsString() +{ + ::rtl::OString aIn("A"); + CPPUNIT_ASSERT(::comphelper::string::equals(aIn, 'A')); + CPPUNIT_ASSERT(!::comphelper::string::equals(aIn, 'B')); + aIn = ::rtl::OString("AA"); + CPPUNIT_ASSERT(!::comphelper::string::equals(aIn, 'A')); + aIn = ::rtl::OString(); + CPPUNIT_ASSERT(!::comphelper::string::equals(aIn, 'A')); +} + CPPUNIT_TEST_SUITE_REGISTRATION(TestString); } |