[Libreoffice-commits] core.git: tools/qa

Stephan Bergmann sbergman at redhat.com
Tue Jan 24 09:08:12 UTC 2017


 tools/qa/cppunit/test_urlobj.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 635d4b0eb8ccdec84d78c9b1d2aa113f6250e1f2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 24 10:07:31 2017 +0100

    Clarify some INetURLObject::setExtension behavior
    
    Change-Id: I1a9e7233b2861a3d09661a08c07d2043c9c0c3c1

diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index 00ca3f7..2dfc092 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -357,6 +357,16 @@ namespace tools_urlobj
                 !INetURLObject("vnd.sun.star.pkg://example.org").isAnyKnownWebDAVScheme());
         }
 
+        void testSetExtension() {
+            INetURLObject obj("file:///foo/bar.baz/");
+            bool ok = obj.setExtension(
+                "other", INetURLObject::LAST_SEGMENT, false);
+            CPPUNIT_ASSERT(ok);
+            CPPUNIT_ASSERT_EQUAL(
+                OUString("file:///foo/bar.baz/.other"),
+                obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+        }
+
         // Change the following lines only, if you add, remove or rename
         // member functions of the current class,
         // because these macros are need by auto register mechanism.
@@ -373,6 +383,7 @@ namespace tools_urlobj
         CPPUNIT_TEST( urlobjTest_data );
         CPPUNIT_TEST( urlobjTest_isSchemeEqualTo );
         CPPUNIT_TEST( urlobjTest_isAnyKnownWebDAVScheme );
+        CPPUNIT_TEST( testSetExtension );
         CPPUNIT_TEST_SUITE_END(  );
     };                          // class createPool
 


More information about the Libreoffice-commits mailing list