diff options
author | Wei Wei <weiwei@multicorewareinc.com> | 2013-12-13 11:48:38 -0600 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-18 20:34:50 -0600 |
commit | df54e4f174659e2a4ceba517c30e7af2a633b0fb (patch) | |
tree | e7c77985db537f9c71d45a101fa16a4d8a095a12 /sc/qa | |
parent | a70dfc34a67e9fb240cc70853da0c49fa01c2e4f (diff) |
GPU Calc: VLOOKUP implementation
Change-Id: I0bec6d69f3302f01829bac903f68bc0f28db4c9d
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/spreadsheet/VLookup.xls | bin | 0 -> 26624 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/spreadsheet/VLookup.xls b/sc/qa/unit/data/xls/opencl/spreadsheet/VLookup.xls Binary files differnew file mode 100644 index 000000000000..89fd6db03692 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/spreadsheet/VLookup.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 833d9c0824a6..e1f435e8f73b 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -244,6 +244,7 @@ public: void testMathFormulaSumProduct(); void testMathFormulaSumProduct2(); void testStatisticalParallelCountBug(); + void testSpreadSheetFormulaVLookup(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -419,6 +420,7 @@ public: CPPUNIT_TEST(testMathFormulaSumProduct); CPPUNIT_TEST(testMathFormulaSumProduct2); CPPUNIT_TEST(testStatisticalParallelCountBug); + CPPUNIT_TEST(testSpreadSheetFormulaVLookup); CPPUNIT_TEST_SUITE_END(); private: @@ -4130,6 +4132,35 @@ void ScOpenclTest::testMathFormulaLog() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-171] +void ScOpenclTest::testSpreadSheetFormulaVLookup() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/spreadsheet/VLookup.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/spreadsheet/VLookup.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 32; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(5,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(5,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + for (SCROW i = 40; i <= 50; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(5,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(5,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-173] void ScOpenclTest::testStatisticalFormulaChiInv() { |