sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 8b66e1745933cd5aa4ae974f709a7e6c8be1f898 Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Dec 14 09:46:50 2020 +0100 Commit: Stephan Bergmann <[email protected]> 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 <[email protected]> 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(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
