LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/qa/extras - scmodelobj.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 27 27 100.0 %
Date: 2013-07-09 Functions: 12 13 92.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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             :  */
       9             : 
      10             : #include <test/unoapi_test.hxx>
      11             : #include <test/sheet/xgoalseek.hxx>
      12             : 
      13             : using namespace css;
      14             : using namespace css::uno;
      15             : 
      16             : namespace sc_apitest {
      17             : 
      18             : #define NUMBER_OF_TESTS 1
      19             : 
      20           2 : class ScModelObj : public UnoApiTest, apitest::XGoalSeek
      21             : {
      22             : public:
      23             :     virtual void setUp();
      24             :     virtual void tearDown();
      25             : 
      26             :     virtual uno::Reference< uno::XInterface > init();
      27             : 
      28             :     ScModelObj();
      29             : 
      30           2 :     CPPUNIT_TEST_SUITE(ScModelObj);
      31           1 :     CPPUNIT_TEST(testSeekGoal);
      32           2 :     CPPUNIT_TEST_SUITE_END();
      33             : 
      34             : private:
      35             :     static sal_Int32 nTest;
      36             :     static uno::Reference< lang::XComponent > mxComponent;
      37             : };
      38             : 
      39           1 : ScModelObj::ScModelObj()
      40           1 :      : UnoApiTest("/sc/qa/extras/testdocuments")
      41             : {
      42           1 : }
      43             : 
      44             : sal_Int32 ScModelObj::nTest = 0;
      45           1 : uno::Reference< lang::XComponent > ScModelObj::mxComponent;
      46             : 
      47           1 : uno::Reference< uno::XInterface > ScModelObj::init()
      48             : {
      49           1 :     OUString aFileURL;
      50           1 :     createFileURL(OUString("ScModelObj.ods"), aFileURL);
      51           1 :     if(!mxComponent.is())
      52           1 :         mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
      53           1 :     CPPUNIT_ASSERT(mxComponent.is());
      54             : 
      55           1 :     return mxComponent;
      56             : }
      57             : 
      58           1 : void ScModelObj::setUp()
      59             : {
      60           1 :     nTest++;
      61           1 :     UnoApiTest::setUp();
      62           1 : }
      63             : 
      64           1 : void ScModelObj::tearDown()
      65             : {
      66           1 :     if (nTest == NUMBER_OF_TESTS)
      67           1 :         closeDocument(mxComponent);
      68             : 
      69           1 :     UnoApiTest::tearDown();
      70           1 : }
      71             : 
      72           1 : CPPUNIT_TEST_SUITE_REGISTRATION(ScModelObj);
      73             : 
      74           1 : CPPUNIT_PLUGIN_IMPLEMENT();
      75             : 
      76           3 : }
      77             : 
      78             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10