summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-12-12 15:16:03 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:53:53 -0600
commitde0a96f1fe417323d0cc26c962bbb49f961ac433 (patch)
treef5dc2faabade23c9a5b98495880d441e46d10619 /sc/qa
parent2ebc7c6ab819771514d7405adb286bad1fa5b489 (diff)
GPU Calc: unit test cases for ROUNDDOWN
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-352 BUG Change-Id: I97d6d93b4706629cb3910c3554cf9b24c330b9e5 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xls/opencl/math/rounddown.xlsbin0 -> 19456 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx26
2 files changed, 25 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/rounddown.xls b/sc/qa/unit/data/xls/opencl/math/rounddown.xls
new file mode 100644
index 000000000000..34d0bc680de4
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/rounddown.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 82c2a22b04d6..e1f06a4ba0cd 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -262,6 +262,7 @@ public:
void testDatabaseFormulaDcountA();
void testMathFormulaDegrees();
void testMathFormulaRoundUp();
+ void testMathFormulaRoundDown();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -455,6 +456,7 @@ public:
CPPUNIT_TEST(testDatabaseFormulaDcountA);
CPPUNIT_TEST(testMathFormulaDegrees);
CPPUNIT_TEST(testMathFormulaRoundUp);
+ CPPUNIT_TEST(testMathFormulaRoundDown);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5312,7 +5314,29 @@ void ScOpenclTest::testMathFormulaRoundUp()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
+//[ AMLOEXT-352]
+void ScOpenclTest::testMathFormulaRoundDown()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/rounddown.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/rounddown.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//AMLOEXT-356
void ScOpenclTest::testMathFormulaDegrees()
{