diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-02 16:08:53 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-03 09:32:06 +0100 |
commit | 5a44e3772adb281d16757cdac3120d56565a96e5 (patch) | |
tree | 80d5c447d321025c3c0ec69c19071f7011dea11a /ucb/qa/cppunit | |
parent | 17dface79321c87b2d30a53a67aeda2e9f9dfff6 (diff) |
ucb: webdav-curl: convert webdav unit tests to curl
There's no point in building the tests for neon any more, just build
them only if curl is used.
This finds a bug in CurlUri::Init() where query and fragment separators
need to be added manually.
Change-Id: I3dcd1512450522df2c2a7d223b2e29b6c0e794fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124607
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb/qa/cppunit')
-rw-r--r-- | ucb/qa/cppunit/webdav/webdav_local_neon.cxx | 31 | ||||
-rw-r--r-- | ucb/qa/cppunit/webdav/webdav_options.cxx | 2 | ||||
-rw-r--r-- | ucb/qa/cppunit/webdav/webdav_propfindcache.cxx | 4 | ||||
-rw-r--r-- | ucb/qa/cppunit/webdav/webdav_resource_access.cxx | 2 |
4 files changed, 26 insertions, 13 deletions
diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx index a88266020787..a2208ffaccad 100644 --- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx +++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx @@ -10,9 +10,9 @@ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/plugin/TestPlugIn.h> -#include <NeonUri.hxx> +#include <CurlUri.hxx> -using namespace webdav_ucp; +using namespace http_dav_ucp; namespace { @@ -21,26 +21,39 @@ namespace { public: - void NeonUriTest(); + void WebdavUriTest(); + void WebdavUriTest2(); // 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. CPPUNIT_TEST_SUITE( webdav_local_test ); - CPPUNIT_TEST( NeonUriTest ); + CPPUNIT_TEST( WebdavUriTest ); + CPPUNIT_TEST( WebdavUriTest2 ); CPPUNIT_TEST_SUITE_END(); }; // class webdav_local_test - void webdav_local_test::NeonUriTest() + void webdav_local_test::WebdavUriTest() { //try URL decomposition - NeonUri aURI( "http://user%40anothername@server.biz:8040/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" ); + CurlUri aURI(u"http://user%40anothername@server.biz:8040/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" ); CPPUNIT_ASSERT_EQUAL( OUString( "http" ), aURI.GetScheme() ); CPPUNIT_ASSERT_EQUAL( OUString( "server.biz" ), aURI.GetHost() ); - CPPUNIT_ASSERT_EQUAL( OUString( "user%40anothername" ), aURI.GetUserInfo() ); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 8040 ), aURI.GetPort() ); - CPPUNIT_ASSERT_EQUAL( OUString( "/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" ), aURI.GetPath( ) ); + CPPUNIT_ASSERT_EQUAL( OUString( "user%40anothername" ), aURI.GetUser() ); + CPPUNIT_ASSERT_EQUAL( sal_uInt16( 8040 ), aURI.GetPort() ); + CPPUNIT_ASSERT_EQUAL( OUString( "/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" ), aURI.GetRelativeReference() ); + } + + void webdav_local_test::WebdavUriTest2() + { + CurlUri aURI(u"https://foo:bar@server.biz:8040/aService#aaa" ); + CPPUNIT_ASSERT_EQUAL( OUString("https"), aURI.GetScheme() ); + CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), aURI.GetHost() ); + CPPUNIT_ASSERT_EQUAL( OUString("foo"), aURI.GetUser() ); + CPPUNIT_ASSERT_EQUAL( OUString("bar"), aURI.GetPassword() ); + CPPUNIT_ASSERT_EQUAL( sal_uInt16( 8040 ), aURI.GetPort() ); + CPPUNIT_ASSERT_EQUAL( OUString( "/aService#aaa" ), aURI.GetRelativeReference() ); } CPPUNIT_TEST_SUITE_REGISTRATION( webdav_local_test ); diff --git a/ucb/qa/cppunit/webdav/webdav_options.cxx b/ucb/qa/cppunit/webdav/webdav_options.cxx index eee94af2a82b..7fd0e7dedd13 100644 --- a/ucb/qa/cppunit/webdav/webdav_options.cxx +++ b/ucb/qa/cppunit/webdav/webdav_options.cxx @@ -11,7 +11,7 @@ #include <cppunit/plugin/TestPlugIn.h> #include <DAVTypes.hxx> -using namespace webdav_ucp; +using namespace http_dav_ucp; namespace { diff --git a/ucb/qa/cppunit/webdav/webdav_propfindcache.cxx b/ucb/qa/cppunit/webdav/webdav_propfindcache.cxx index 03ccdbe7aae7..a9f24345e33c 100644 --- a/ucb/qa/cppunit/webdav/webdav_propfindcache.cxx +++ b/ucb/qa/cppunit/webdav/webdav_propfindcache.cxx @@ -11,7 +11,7 @@ #include <cppunit/plugin/TestPlugIn.h> #include <PropfindCache.hxx> -using namespace webdav_ucp; +using namespace http_dav_ucp; namespace { @@ -113,7 +113,7 @@ namespace // add the cache an element aPropsNames.setPropertiesNames( std::vector(aProps) ); - PropCache.addCachePropertyNames( aPropsNames ); + PropCache.addCachePropertyNames( aPropsNames, 10 ); PropertyNames aRetPropsNames; //test existence diff --git a/ucb/qa/cppunit/webdav/webdav_resource_access.cxx b/ucb/qa/cppunit/webdav/webdav_resource_access.cxx index d1a73be2d5f3..85d3e1c236a6 100644 --- a/ucb/qa/cppunit/webdav/webdav_resource_access.cxx +++ b/ucb/qa/cppunit/webdav/webdav_resource_access.cxx @@ -12,7 +12,7 @@ #include <DAVResourceAccess.hxx> #include <DAVException.hxx> -using namespace webdav_ucp; +using namespace http_dav_ucp; namespace { |