Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / qa / unit / functions_test.cxx
blob1a48c03432d90834ca29a7c576977b9b592e4243
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 */
11 #include "functions_test.hxx"
12 #include <document.hxx>
14 FunctionsTest::FunctionsTest(const OUString& rPath):
15 ScBootstrapFixture(rPath)
19 void FunctionsTest::setUp()
21 ScBootstrapFixture::setUp();
23 // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
24 // which is a private symbol to us, gets called
25 m_xCalcComponent =
26 getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
27 CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
30 bool FunctionsTest::load(const OUString& rFilter, const OUString& rURL,
31 const OUString& rUserData, SfxFilterFlags nFilterFlags,
32 SotClipboardFormatId nClipboardID,
33 unsigned int nFilterVersion)
35 ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData,
36 OUString(), nFilterFlags, nClipboardID, nFilterVersion );
37 CPPUNIT_ASSERT(xDocShRef.is());
39 xDocShRef->DoHardRecalc();
41 ScDocument& rDoc = xDocShRef->GetDocument();
43 #ifdef __APPLE__
44 // FIXME tends to fail a lot
45 if (!rURL.endsWith("forecast.ets.add.fods"))
46 #endif
47 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, rDoc.GetValue(1, 2, 0), 1e-14);
49 xDocShRef->DoClose();
51 return true;
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */