LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / dbaccess / qa / extras / macros-test.cxx
blobdee5919c3463342d04a027ef788c6f870f14d5d4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
11 #include <test/unoapi_test.hxx>
12 #include <com/sun/star/util/XCloseable.hpp>
14 using namespace ::com::sun::star;
15 using namespace ::com::sun::star::uno;
17 #if !defined(MACOSX) && !defined(_WIN32)
19 class DBAccessTest : public UnoApiTest
21 public:
22 DBAccessTest();
24 void test();
26 CPPUNIT_TEST_SUITE(DBAccessTest);
27 CPPUNIT_TEST(test);
28 CPPUNIT_TEST_SUITE_END();
31 DBAccessTest::DBAccessTest()
32 : UnoApiTest("/dbaccess/qa/extras/testdocuments")
36 void DBAccessTest::test()
38 OUString aFileName;
39 createFileURL(u"testdb.odb", aFileName);
40 uno::Reference<lang::XComponent> xComponent = loadFromDesktop(aFileName);
41 uno::Reference<util::XCloseable> xDocCloseable(xComponent, UNO_QUERY_THROW);
42 xDocCloseable->close(false);
45 CPPUNIT_TEST_SUITE_REGISTRATION(DBAccessTest);
47 #endif
49 CPPUNIT_PLUGIN_IMPLEMENT();
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */