summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorƁukasz Hryniuk <lukasz.hryniuk@wp.pl>2015-09-18 20:18:20 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-20 11:16:17 +0000
commit5d22a10b5a665696a7afbdcfa9eb10e278704c1d (patch)
treed7e9a115e0fa6780855fb5f4cc92f1aab5754e22
parent465f493623aecc2d2559aa52d6f52da12854e8cc (diff)
Performance test for FTest
Change-Id: I9dc6298b7843c089f58e2bf8ee663f72088a5752 Reviewed-on: https://gerrit.libreoffice.org/18705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/qa/perf/scperfobj.cxx26
-rw-r--r--sc/qa/perf/testdocuments/scMathFunctions.odsbin42552 -> 46108 bytes
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 9c79e28024d3..310c004ca675 100644
--- a/sc/qa/perf/scperfobj.cxx
+++ b/sc/qa/perf/scperfobj.cxx
@@ -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);
}
diff --git a/sc/qa/perf/testdocuments/scMathFunctions.ods b/sc/qa/perf/testdocuments/scMathFunctions.ods
index e87c88a2a923..b80f8f6c19a0 100644
--- a/sc/qa/perf/testdocuments/scMathFunctions.ods
+++ b/sc/qa/perf/testdocuments/scMathFunctions.ods
Binary files differ