diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-10 11:08:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-10 11:09:08 +0000 |
commit | 9c19e79f19f0dbd55def4a0cf473248ea91e188e (patch) | |
tree | a75fc652a3d79b4a18d69a7f3af3bb5b8f369262 /comphelper/qa/string | |
parent | 40cddfce8b2e53a4203760b40833bbd9092cac68 (diff) |
extend unit test to islower
Diffstat (limited to 'comphelper/qa/string')
-rw-r--r-- | comphelper/qa/string/test_string.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 1fb892217740..82eaee04bd90 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -57,6 +57,7 @@ public: void testIsdigitAsciiString(); void testIsalnumAsciiString(); void testIsupperAsciiString(); + void testIslowerAsciiString(); void testIndexOfL(); void testMatchIgnoreAsciiCaseL(); @@ -74,6 +75,7 @@ public: CPPUNIT_TEST(testIsdigitAsciiString); CPPUNIT_TEST(testIsalnumAsciiString); CPPUNIT_TEST(testIsupperAsciiString); + CPPUNIT_TEST(testIslowerAsciiString); CPPUNIT_TEST(testIndexOfL); CPPUNIT_TEST(testMatchIgnoreAsciiCaseL); CPPUNIT_TEST_SUITE_END(); @@ -146,6 +148,18 @@ void TestString::testIsalnumAsciiString() rtl::OString s4(RTL_CONSTASCII_STRINGPARAM("1A[4")); CPPUNIT_ASSERT_EQUAL(comphelper::string::isalnumAsciiString(s4), false); + + rtl::OUString s5(RTL_CONSTASCII_USTRINGPARAM("1234")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isalnumAsciiString(s5), true); + + rtl::OUString s6(RTL_CONSTASCII_USTRINGPARAM("1A34")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isalnumAsciiString(s6), true); + + rtl::OUString s7; + CPPUNIT_ASSERT_EQUAL(comphelper::string::isalnumAsciiString(s7), true); + + rtl::OUString s8(RTL_CONSTASCII_USTRINGPARAM("1A[4")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isalnumAsciiString(s8), false); } void TestString::testIsupperAsciiString() @@ -158,6 +172,36 @@ void TestString::testIsupperAsciiString() rtl::OString s3(RTL_CONSTASCII_STRINGPARAM("AABB")); CPPUNIT_ASSERT_EQUAL(comphelper::string::isupperAsciiString(s3), true); + + rtl::OUString s4(RTL_CONSTASCII_USTRINGPARAM("1234")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isupperAsciiString(s4), false); + + rtl::OUString s5(RTL_CONSTASCII_USTRINGPARAM("aAbB")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isupperAsciiString(s5), false); + + rtl::OUString s6(RTL_CONSTASCII_USTRINGPARAM("AABB")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::isupperAsciiString(s6), true); +} + +void TestString::testIslowerAsciiString() +{ + rtl::OString s1(RTL_CONSTASCII_STRINGPARAM("1234")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s1), false); + + rtl::OString s2(RTL_CONSTASCII_STRINGPARAM("aAbB")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s2), false); + + rtl::OString s3(RTL_CONSTASCII_STRINGPARAM("aabb")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s3), true); + + rtl::OUString s4(RTL_CONSTASCII_USTRINGPARAM("1234")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s4), false); + + rtl::OUString s5(RTL_CONSTASCII_USTRINGPARAM("aAbB")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s5), false); + + rtl::OUString s6(RTL_CONSTASCII_USTRINGPARAM("aabb")); + CPPUNIT_ASSERT_EQUAL(comphelper::string::islowerAsciiString(s6), true); } void TestString::testIndexOfL() |