Kaydet (Commit) 5d22a10b authored tarafından Łukasz Hryniuk's avatar Łukasz Hryniuk Kaydeden (comit) Markus Mohrhard

Performance test for FTest

Change-Id: I9dc6298b7843c089f58e2bf8ee663f72088a5752
Reviewed-on: https://gerrit.libreoffice.org/18705Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 465f4936
......@@ -59,6 +59,7 @@ public:
CPPUNIT_TEST(testSheetNamedRanges);
CPPUNIT_TEST(testSheets);
CPPUNIT_TEST(testSum);
CPPUNIT_TEST(testFTest);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -71,6 +72,7 @@ private:
void testSheetNamedRanges();
void testSheets();
void testSum();
void testFTest();
};
......@@ -289,6 +291,30 @@ void ScPerfObj::testSum()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Sum - number of elements equal 30" , 99.0, xCell->getValue());
}
void ScPerfObj::testFTest()
{
uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions.ods"), UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is());
uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW);
// get getSheets
uno::Reference< sheet::XSpreadsheets > xSheets (xDoc->getSheets(), UNO_QUERY_THROW);
uno::Any rSheet = xSheets->getByName(OUString::createFromAscii("FTestSheet"));
// query for the XSpreadsheet interface
uno::Reference< sheet::XSpreadsheet > xSheet (rSheet, UNO_QUERY);
uno::Reference< table::XCell > xCell = xSheet->getCellByPosition(0, 0);
callgrindStart();
xCell->setFormula(OUString::createFromAscii("=FTEST(B1:K10;L1:U10)"));
xCalculatable->calculate();
callgrindDump("sc:ftest");
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Wrong FTest result" , 0.8909, xCell->getValue(), 10e-4);
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScPerfObj);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment