summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-22 12:52:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-25 16:35:37 +0200
commit9a7d2d72cef7ff14a020c1024fbff8c00e4e4aff (patch)
tree45c2ab6d7ecd896f990633346a2dd842d3e67c2f /sal
parentdrop unused defines (diff)
downloadcore-9a7d2d72cef7ff14a020c1024fbff8c00e4e4aff.tar.gz
core-9a7d2d72cef7ff14a020c1024fbff8c00e4e4aff.zip
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')
-rw-r--r--sal/qa/rtl/strings/test_ostring.cxx11
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);
}