diff options
author | David Ostrovsky <david@ostrovsky.org> | 2012-11-20 22:19:51 +0100 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2012-11-20 22:40:40 +0100 |
commit | 4b9c10e298a5285edbeb87c47303c151209abded (patch) | |
tree | 5667f56c2049b12378268ae8c07256c96a235e7d /connectivity/qa | |
parent | d23764182ccb5d1e96774cc958a7afaaa659e114 (diff) |
fdo#57285 restore acceptsURL logic
Change-Id: Ib03c7e4a78510eb0300d78a0ae3e83ec6a17f72f
Diffstat (limited to 'connectivity/qa')
-rw-r--r-- | connectivity/qa/connectivity/mork/DriverTest.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/connectivity/qa/connectivity/mork/DriverTest.cxx b/connectivity/qa/connectivity/mork/DriverTest.cxx index 1db1d9f7c1e0..33720ac4b2d8 100644 --- a/connectivity/qa/connectivity/mork/DriverTest.cxx +++ b/connectivity/qa/connectivity/mork/DriverTest.cxx @@ -27,6 +27,7 @@ class MorkDriverTest: public test::BootstrapFixture public: MorkDriverTest() : test::BootstrapFixture(false, false) {}; + void checkAcceptsURL(Reference< XDriver> xDriver, const char* url, bool expected); void test_metadata(); void test_select_default_all(); void test_select_list_table_joe_doe_5(); @@ -46,6 +47,15 @@ private: Reference<XConnection> m_xConnection; }; +void MorkDriverTest::checkAcceptsURL(Reference< XDriver> xDriver, const char* url, bool expected) +{ + sal_Bool res = xDriver->acceptsURL(OUString::createFromAscii(url)); + if (res != expected) + { + CPPUNIT_ASSERT_MESSAGE("wrong URL outcome!", true); + } +} + void MorkDriverTest::setUp() { test::BootstrapFixture::setUp(); @@ -64,6 +74,18 @@ void MorkDriverTest::setUp() CPPUNIT_ASSERT_MESSAGE("cannot connect to mork driver!", xDriver.is()); } + // bad + checkAcceptsURL(xDriver, "sdbc:address:macab", false); + checkAcceptsURL(xDriver, "sdbc:mozab:ldap:", false); + checkAcceptsURL(xDriver, "sdbc:mozab:outlook:", false); + checkAcceptsURL(xDriver, "sdbc:mozab:outlookexp:", false); + + // good + checkAcceptsURL(xDriver, "sdbc:mozab:mozilla:", true); + checkAcceptsURL(xDriver, "sdbc:mozab:thunderbird:", true); + checkAcceptsURL(xDriver, "sdbc:address:mozilla:", true); + checkAcceptsURL(xDriver, "sdbc:address:thunderbird:", true); + m_xConnection = xDriver->connect(url, info); if (!m_xConnection.is()) { |