diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-22 12:52:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-25 16:35:37 +0200 |
commit | 9a7d2d72cef7ff14a020c1024fbff8c00e4e4aff (patch) | |
tree | 45c2ab6d7ecd896f990633346a2dd842d3e67c2f /sal/qa | |
parent | 4da36c9af3bc31c8efb9505fe3d07a22cd51c487 (diff) |
tell msvc our source code is written using utf-8
Change-Id: I4fb364ceb34e0851f2d04c403333bf428e8cfa98
Reviewed-on: https://gerrit.libreoffice.org/40305
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/rtl/strings/test_ostring.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sal/qa/rtl/strings/test_ostring.cxx b/sal/qa/rtl/strings/test_ostring.cxx index cd2e0a22bb99..110831758916 100644 --- a/sal/qa/rtl/strings/test_ostring.cxx +++ b/sal/qa/rtl/strings/test_ostring.cxx @@ -20,10 +20,12 @@ class Test: public CppUnit::TestFixture { private: void testStartsWithIgnoreAsciiCase(); void testCompareTo(); + void testUtf8StringLiterals(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testStartsWithIgnoreAsciiCase); CPPUNIT_TEST(testCompareTo); + CPPUNIT_TEST(testUtf8StringLiterals); CPPUNIT_TEST_SUITE_END(); }; @@ -105,6 +107,15 @@ void Test::testCompareTo() CPPUNIT_ASSERT(OString(s2 + "y").compareTo(s1) > 0); } +void Test::testUtf8StringLiterals() +{ + const OString sIn(u8"ßa"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sIn.getLength()); + CPPUNIT_ASSERT_EQUAL(-61, static_cast<int>(sIn[0])); + CPPUNIT_ASSERT_EQUAL(-97, static_cast<int>(sIn[1])); + CPPUNIT_ASSERT_EQUAL(97, static_cast<int>(sIn[2])); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |