diff options
author | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-18 13:39:02 -0600 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-18 15:59:14 -0600 |
commit | af223ecdf01b76bc1005c8fcc342165639a8823f (patch) | |
tree | 6c257a51be75853546fd5836f16281b29d4b8e7b /sc/qa | |
parent | c935a91260aaba79300cf516bac044ebb8dc7ef9 (diff) |
GPU Calc: testcases for horizontal ranges
AMLOEXT-242 BUG
Change-Id: I4b87bdf6183ed81ad767550f5cd49aab51531cf2
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/compiler/horizontal.ods | bin | 0 -> 8438 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/compiler/horizontal.ods b/sc/qa/unit/data/ods/opencl/compiler/horizontal.ods Binary files differnew file mode 100644 index 000000000000..18edf64bd67f --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/compiler/horizontal.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 3f9004043c1a..3f02d9bdd0d0 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -81,6 +81,7 @@ public: void testFinacialRateFormula(); void testFinancialAccrintmFormula(); void testFinancialAccrintFormula(); + void testCompilerHorizontal(); void testCompilerNested(); void testFinacialSLNFormula(); void testStatisticalFormulaGammaLn(); @@ -251,6 +252,7 @@ public: CPPUNIT_TEST(testFinacialIRRFormula); CPPUNIT_TEST(testFinacialMIRRFormula); CPPUNIT_TEST(testFinacialRateFormula); + CPPUNIT_TEST(testCompilerHorizontal); CPPUNIT_TEST(testCompilerNested); CPPUNIT_TEST(testFinacialSLNFormula); CPPUNIT_TEST(testFinancialAccrintmFormula); @@ -443,6 +445,36 @@ void ScOpenclTest::enableOpenCL() sc::FormulaGroupInterpreter::enableOpenCL(true); } +void ScOpenclTest::testCompilerHorizontal() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/compiler/horizontal.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/compiler/horizontal.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i < 5; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(12, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(12, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + fLibre = pDoc->GetValue(ScAddress(13, i, 0)); + fExcel = pDocRes->GetValue(ScAddress(13, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + fLibre = pDoc->GetValue(ScAddress(14, i, 0)); + fExcel = pDocRes->GetValue(ScAddress(14, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} void ScOpenclTest::testCompilerNested() { if (!detectOpenCLDevice()) |