summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorfengzeng <fengzeng@multicorewareinc.com>2013-11-04 16:20:25 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-05 14:13:05 -0600
commit041d7146412750ded74bfe7e59c14e7ffd9d35ac (patch)
tree6a44e17c95a06facaeab29d97a250b49cad6f9e7 /sc/qa
parentc1492fe9ea81eb7d6af3e636f022a23fb7874b9d (diff)
GPU Calc: unit test cases for SIN
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-58 BUG Change-Id: I484b86650e3e7bb11aa59aad6ae01be152aa2cef Signed-off-by: haochen <haochen@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/sin.xlsbin0 -> 6656 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/sin.xls b/sc/qa/unit/data/xls/opencl/math/sin.xls
new file mode 100644
index 000000000000..71ea0d1aedb3
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/sin.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index de5bd74f9f53..415b99cabac2 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -125,6 +125,7 @@ public:
void testMathFormulaSinh();
void testMathFormulaAbs();
void testFinacialPVFormula();
+ void testMathFormulaSin();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -181,6 +182,7 @@ public:
CPPUNIT_TEST(testMathFormulaSinh);
CPPUNIT_TEST(testMathFormulaAbs);
CPPUNIT_TEST(testFinacialPVFormula);
+ CPPUNIT_TEST(testMathFormulaSin);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1173,6 +1175,28 @@ void ScOpenclTest::testStatisticalFormulaNegbinomdist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-58]
+void ScOpenclTest::testMathFormulaSin()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/sin.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/sin.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 15; ++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-63]
void ScOpenclTest::testFinacialPriceFormula()
{