[Libreoffice-commits] core.git: sal/qa
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 14 10:16:50 UTC 2020
sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 8b66e1745933cd5aa4ae974f709a7e6c8be1f898
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Dec 14 09:46:50 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Dec 14 11:16:15 2020 +0100
Add empty OUStringBuffer::toString test
...motivated by <https://gerrit.libreoffice.org/c/core/+/107643> "Don't crash on
an empty OUStringBuffer::toString"
Change-Id: I144f0814f585f56df3fcdc818fd8c5e18ad08115
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107672
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
index 66231d8b856f..d942480d1748 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx
@@ -28,9 +28,11 @@ namespace test::oustringbuffer {
class ToString: public CppUnit::TestFixture {
private:
+ void testEmptyToString();
void testToString();
CPPUNIT_TEST_SUITE(ToString);
+ CPPUNIT_TEST(testEmptyToString);
CPPUNIT_TEST(testToString);
CPPUNIT_TEST_SUITE_END();
};
@@ -39,6 +41,12 @@ private:
CPPUNIT_TEST_SUITE_REGISTRATION(test::oustringbuffer::ToString);
+void test::oustringbuffer::ToString::testEmptyToString() {
+ OUStringBuffer sb;
+ OUString str = sb.toString();
+ CPPUNIT_ASSERT_EQUAL(OUString(), str);
+}
+
void test::oustringbuffer::ToString::testToString() {
OUStringBuffer sb("test string");
OUString str = sb.toString();
More information about the Libreoffice-commits
mailing list