sc/qa/extras/macros-test.cxx | 68 +++++----- sc/qa/extras/vba-macro-test.cxx | 114 ++++++++--------- sc/qa/unit/opencl-test-1.cxx | 266 ++++++++++++++++++++-------------------- 3 files changed, 224 insertions(+), 224 deletions(-)
New commits: commit aa4d14ab38bb4173cdcaebe8417cf6464381f9ca Author: Swarnadeep Paul <[email protected]> AuthorDate: Tue Feb 17 00:23:23 2026 +0530 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Tue Feb 17 18:53:51 2026 +0100 tdf#170685 Replace use of ScAddress() to get the value It is to fix and optimize the code because the variants (see below) taking ScAddress internally call the latter variants. Variants addressed: pDoc->GetValue() pDoc->SetValue() pDoc->GetString() Change-Id: Id73825da8c8ae554d0eb3d3464c780da82541e27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199506 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index f668f9cad3c5..36c949241898 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -149,14 +149,14 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf146742) saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); - CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0,0,0))); - CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0,1,0))); + CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(0,0,0)); + CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(0,1,0)); - CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(1,0,0))); + CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(1,0,0)); // Without the fix in place, this test would have failed with // - Expected: FALSE // - Actual : TRUE - CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(ScAddress(1,1,0))); + CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(1,1,0)); } CPPUNIT_TEST_FIXTURE(ScMacrosTest, testMacroButtonFormControlXlsxExport) @@ -192,13 +192,13 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf104902) saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); - CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(0, 0, 0)); // Without the fix in place, this test would have failed with // - Expected: string with // newlines // - Actual : string withnewlines - CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(ScAddress(0, 1, 0))); + CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(0, 1, 0)); } CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf64639) @@ -235,15 +235,15 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf142033) saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); - CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(ScAddress(0,0,0))); - CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(ScAddress(0,1,0))); + CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(0,0,0)); + CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(0,1,0)); // Without the fix in place, this test would have failed with // - Expected: string with // newlines // - Actual : string withnewlines - CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(ScAddress(1,0,0))); - CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(ScAddress(1,1,0))); + CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(1,0,0)); + CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), pDoc->GetString(1,1,0)); } CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf89920) @@ -433,20 +433,20 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf46119) executeMacro(u"vnd.sun.Star.script:Standard.Module1.Main?language=Basic&location=document"_ustr); - CPPUNIT_ASSERT_EQUAL(u"0.074"_ustr, pDoc->GetString(ScAddress(2, 24, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.067"_ustr, pDoc->GetString(ScAddress(2, 25, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.273"_ustr, pDoc->GetString(ScAddress(2, 26, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.259"_ustr, pDoc->GetString(ScAddress(2, 27, 0))); + CPPUNIT_ASSERT_EQUAL(u"0.074"_ustr, pDoc->GetString(2, 24, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.067"_ustr, pDoc->GetString(2, 25, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.273"_ustr, pDoc->GetString(2, 26, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.259"_ustr, pDoc->GetString(2, 27, 0)); - CPPUNIT_ASSERT_EQUAL(u"0.097"_ustr, pDoc->GetString(ScAddress(3, 24, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.087"_ustr, pDoc->GetString(ScAddress(3, 25, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.311"_ustr, pDoc->GetString(ScAddress(3, 26, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.296"_ustr, pDoc->GetString(ScAddress(3, 27, 0))); + CPPUNIT_ASSERT_EQUAL(u"0.097"_ustr, pDoc->GetString(3, 24, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.087"_ustr, pDoc->GetString(3, 25, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.311"_ustr, pDoc->GetString(3, 26, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.296"_ustr, pDoc->GetString(3, 27, 0)); - CPPUNIT_ASSERT_EQUAL(u"0.149"_ustr, pDoc->GetString(ScAddress(4, 24, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.134"_ustr, pDoc->GetString(ScAddress(4, 25, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.386"_ustr, pDoc->GetString(ScAddress(4, 26, 0))); - CPPUNIT_ASSERT_EQUAL(u"0.366"_ustr, pDoc->GetString(ScAddress(4, 27, 0))); + CPPUNIT_ASSERT_EQUAL(u"0.149"_ustr, pDoc->GetString(4, 24, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.134"_ustr, pDoc->GetString(4, 25, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.386"_ustr, pDoc->GetString(4, 26, 0)); + CPPUNIT_ASSERT_EQUAL(u"0.366"_ustr, pDoc->GetString(4, 27, 0)); } CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf128218) @@ -496,9 +496,9 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf43003) ScDocument* pDoc = getScDoc(); // Without the fix in place, the values of the specified cells won't be changed - pDoc->SetValue(ScAddress(0, 0, 0), 2); - CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(1, 0, 0))); - CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(ScAddress(2, 0, 0))); + pDoc->SetValue(0, 0, 0, 2); + CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(1, 0, 0)); + CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(2, 0, 0)); } @@ -511,7 +511,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf75263) pDoc->CalcAll(); // A1 contains formula with user-defined function, and the function is defined in VBA. - CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(0, 0, 0)); } saveAndReload(TestFilter::XLSM); @@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf75263) // Without the accompanying fix in place, this test would have failed with: // - Expected: проба (sample) // - Actual : ????? - CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(0, 0, 0)); } } @@ -705,7 +705,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf105558) // Without the fix in place, this test would have failed with // - Expected: 5.5 // - Actual : 0 - CPPUNIT_ASSERT_EQUAL(5.5, pDoc->GetValue(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(5.5, pDoc->GetValue(0, 0, 0)); } CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf107572) @@ -1053,7 +1053,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf161948NaturalSortDispatcher) = { u"ID"_ustr, u"K2"_ustr, u"K3"_ustr, u"K10"_ustr, u"K23"_ustr, u"K104"_ustr }; for (SCROW nRow = 0; nRow <= 5; nRow++) // ScAddress(col, row, tab) { - CPPUNIT_ASSERT_EQUAL(aExpectedNaturalSort[nRow], pDoc->GetString(ScAddress(0, nRow, 0))); + CPPUNIT_ASSERT_EQUAL(aExpectedNaturalSort[nRow], pDoc->GetString(0, nRow, 0)); } // Same test for alpha-numeric sort, that is NaturalSort=false. @@ -1065,7 +1065,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf161948NaturalSortDispatcher) = { u"ID"_ustr, u"K10"_ustr, u"K104"_ustr, u"K2"_ustr, u"K23"_ustr, u"K3"_ustr }; for (SCROW nRow = 0; nRow <= 5; nRow++) { - CPPUNIT_ASSERT_EQUAL(aExpectedAlphaNumeric[nRow], pDoc->GetString(ScAddress(0, nRow, 0))); + CPPUNIT_ASSERT_EQUAL(aExpectedAlphaNumeric[nRow], pDoc->GetString(0, nRow, 0)); } } @@ -1079,7 +1079,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf168750) // Without the fix, this would fail with // - Unexpected dialog: Error: BASIC runtime error. Argument is not optional. // Which indicates, that the class module function was unexpectedly called. - CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(ScAddress(1, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(1, 0, 0)); } #if defined(_WIN32) // DDE calls work only on Windows currently @@ -1090,15 +1090,15 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testDdePoke) createScDoc("DdePoke.fods"); ScDocument* pDoc = getScDoc(); // A1 has a text: - CPPUNIT_ASSERT_EQUAL(u"Hello from Sender"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"Hello from Sender"_ustr, pDoc->GetString(0, 0, 0)); // B2 is empty initially: - CPPUNIT_ASSERT(pDoc->GetString(ScAddress(1, 1, 0)).isEmpty()); + CPPUNIT_ASSERT(pDoc->GetString(1, 1, 0).isEmpty()); executeMacro(u"vnd.sun.star.script:Standard.Module1.SendDataWithDDEPoke" "?language=Basic&location=document"_ustr); // B2 has the expected text now: - CPPUNIT_ASSERT_EQUAL(u"Hello from Sender"_ustr, pDoc->GetString(ScAddress(1, 1, 0))); + CPPUNIT_ASSERT_EQUAL(u"Hello from Sender"_ustr, pDoc->GetString(1, 1, 0)); } #endif diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx index db7888dc202c..1a9f059936e9 100644 --- a/sc/qa/extras/vba-macro-test.cxx +++ b/sc/qa/extras/vba-macro-test.cxx @@ -103,26 +103,26 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testSimpleCopyAndPaste) ScDocument& rDoc = pDocSh->GetDocument(); // Check state - CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(2, 3, 0))); - CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(ScAddress(2, 4, 0))); - CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(ScAddress(2, 5, 0))); + CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(2, 3, 0)); + CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(2, 4, 0)); + CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(2, 5, 0)); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 3, 0))); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 4, 0))); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 5, 0))); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 3, 0)); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 4, 0)); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 5, 0)); executeMacro( u"vnd.sun.Star.script:VBAProject.Module1.test?language=Basic&location=document"_ustr); // Copy from C4-C6 - CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(2, 3, 0))); - CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(ScAddress(2, 4, 0))); - CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(ScAddress(2, 5, 0))); + CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(2, 3, 0)); + CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(2, 4, 0)); + CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(2, 5, 0)); // Paste to B4-B6 - CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(1, 3, 0))); - CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(ScAddress(1, 4, 0))); - CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(ScAddress(1, 5, 0))); + CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(1, 3, 0)); + CPPUNIT_ASSERT_EQUAL(20.0, rDoc.GetValue(1, 4, 0)); + CPPUNIT_ASSERT_EQUAL(30.0, rDoc.GetValue(1, 5, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testMultiDocumentCopyAndPaste) @@ -148,16 +148,16 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testMultiDocumentCopyAndPaste) ScDocShell* pDocSh = static_cast<ScDocShell*>(pFoundShell); ScDocument& rDoc = pDocSh->GetDocument(); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 1, 0))); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 2, 0))); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 3, 0))); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 1, 0)); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 2, 0)); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 3, 0)); executeMacro( u"vnd.sun.Star.script:VBAProject.Module1.test?language=Basic&location=document"_ustr); - CPPUNIT_ASSERT_EQUAL(200.0, rDoc.GetValue(ScAddress(1, 1, 0))); - CPPUNIT_ASSERT_EQUAL(100.0, rDoc.GetValue(ScAddress(1, 2, 0))); - CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(1, 3, 0))); + CPPUNIT_ASSERT_EQUAL(200.0, rDoc.GetValue(1, 1, 0)); + CPPUNIT_ASSERT_EQUAL(100.0, rDoc.GetValue(1, 2, 0)); + CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(1, 3, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testSheetAndColumnSelectAndHide) @@ -582,9 +582,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf149579) CPPUNIT_ASSERT(pDocSh); ScDocument& rDoc = pDocSh->GetDocument(); - rDoc.SetValue(ScAddress(0, 0, 0), 5.0); - rDoc.SetValue(ScAddress(0, 1, 0), 10.0); - rDoc.SetValue(ScAddress(0, 2, 0), 1.0); + rDoc.SetValue(0, 0, 0, 5.0); + rDoc.SetValue(0, 1, 0, 10.0); + rDoc.SetValue(0, 2, 0, 1.0); // Without the fix in place, this call would have crashed in debug builds with failed assertion executeMacro( @@ -593,9 +593,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf149579) // Without the fix in place, this test would have failed with // - Expected: 1 // - Actual : 5 - CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(5.0, rDoc.GetValue(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(5.0, rDoc.GetValue(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(0, 2, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVbaRangeSort) @@ -617,18 +617,18 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVbaRangeSort) CPPUNIT_ASSERT(pDocSh); ScDocument& rDoc = pDocSh->GetDocument(); - rDoc.SetValue(ScAddress(0, 0, 0), 1.0); - rDoc.SetValue(ScAddress(0, 1, 0), 0.5); - rDoc.SetValue(ScAddress(0, 2, 0), 2.0); + rDoc.SetValue(0, 0, 0, 1.0); + rDoc.SetValue(0, 1, 0, 0.5); + rDoc.SetValue(0, 2, 0, 2.0); // Without the fix in place, this call would have crashed in debug builds with failed assertion executeMacro( u"vnd.sun.Star.script:TestLibrary.TestModule.TestRangeSort?language=Basic&location=" "document"_ustr); - CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(0, 2, 0)); // Change sheet's first param sorting order ScSortParam aParam; @@ -643,9 +643,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVbaRangeSort) // Without the fix in place, this test would have failed in non-debug builds with // - Expected: 2 // - Actual : 0.5 - CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(0, 2, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf107885) @@ -697,18 +697,18 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf52602) executeMacro(u"vnd.sun.Star.script:VBAProject.Modul1.Test_NumberFormat_DateTime?language=Basic&" "location=document"_ustr); - CPPUNIT_ASSERT_EQUAL(u"15:20"_ustr, rDoc.GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"15:20"_ustr, rDoc.GetString(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20"_ustr, rDoc.GetString(ScAddress(1, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20"_ustr, rDoc.GetString(ScAddress(1, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20:00"_ustr, rDoc.GetString(ScAddress(2, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20:00"_ustr, rDoc.GetString(ScAddress(2, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/3/12 15:20"_ustr, rDoc.GetString(ScAddress(3, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/3/12 15:20"_ustr, rDoc.GetString(ScAddress(3, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/ March 2012"_ustr, rDoc.GetString(ScAddress(4, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/ March 2012"_ustr, rDoc.GetString(ScAddress(4, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/ Mar 2012"_ustr, rDoc.GetString(ScAddress(5, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"1/ Mar 2012"_ustr, rDoc.GetString(ScAddress(5, 1, 0))); + CPPUNIT_ASSERT_EQUAL(u"15:20"_ustr, rDoc.GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"15:20"_ustr, rDoc.GetString(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20"_ustr, rDoc.GetString(1, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20"_ustr, rDoc.GetString(1, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20:00"_ustr, rDoc.GetString(2, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"03/01/2012 15:20:00"_ustr, rDoc.GetString(2, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/3/12 15:20"_ustr, rDoc.GetString(3, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/3/12 15:20"_ustr, rDoc.GetString(3, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/ March 2012"_ustr, rDoc.GetString(4, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/ March 2012"_ustr, rDoc.GetString(4, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/ Mar 2012"_ustr, rDoc.GetString(5, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"1/ Mar 2012"_ustr, rDoc.GetString(5, 1, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf107902) @@ -914,9 +914,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testForEachInSelection) ScDocShell* pDocSh = static_cast<ScDocShell*>(pFoundShell); ScDocument& rDoc = pDocSh->GetDocument(); - CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, rDoc.GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, rDoc.GetString(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, rDoc.GetString(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, rDoc.GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, rDoc.GetString(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, rDoc.GetString(0, 2, 0)); // tdf#153724: without the fix, this would fail with // assertion failed @@ -927,9 +927,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testForEachInSelection) executeMacro(u"vnd.sun.Star.script:Standard.Module1.TestForEachInSelection?" "language=Basic&location=document"_ustr); - CPPUNIT_ASSERT_EQUAL(u"oof"_ustr, rDoc.GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"rab"_ustr, rDoc.GetString(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"zab"_ustr, rDoc.GetString(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(u"oof"_ustr, rDoc.GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"rab"_ustr, rDoc.GetString(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"zab"_ustr, rDoc.GetString(0, 2, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testNonAsciiMacroIRI) @@ -941,9 +941,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testNonAsciiMacroIRI) ScDocShell* pDocSh = static_cast<ScDocShell*>(pFoundShell); ScDocument& rDoc = pDocSh->GetDocument(); - CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, rDoc.GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, rDoc.GetString(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, rDoc.GetString(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, rDoc.GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, rDoc.GetString(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, rDoc.GetString(0, 2, 0)); auto ret = dispatchCommand(mxComponent, u"macro://./Standard.Module1.NonAsciiName_αβγ"_ustr, {}); @@ -955,9 +955,9 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testNonAsciiMacroIRI) // - Actual : 0 CPPUNIT_ASSERT_EQUAL(css::frame::DispatchResultState::SUCCESS, retEvent.State); - CPPUNIT_ASSERT_EQUAL(u"oof"_ustr, rDoc.GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(u"rab"_ustr, rDoc.GetString(ScAddress(0, 1, 0))); - CPPUNIT_ASSERT_EQUAL(u"zab"_ustr, rDoc.GetString(ScAddress(0, 2, 0))); + CPPUNIT_ASSERT_EQUAL(u"oof"_ustr, rDoc.GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"rab"_ustr, rDoc.GetString(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"zab"_ustr, rDoc.GetString(0, 2, 0)); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf167378) diff --git a/sc/qa/unit/opencl-test-1.cxx b/sc/qa/unit/opencl-test-1.cxx index 27ae9682ffee..8426f6888cdf 100644 --- a/sc/qa/unit/opencl-test-1.cxx +++ b/sc/qa/unit/opencl-test-1.cxx @@ -26,14 +26,14 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerHorizontal) // 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)); + double fLibre = pDoc->GetValue(12, i, 0); + double fExcel = pDocRes->GetValue(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)); + fLibre = pDoc->GetValue(13, i, 0); + fExcel = pDocRes->GetValue(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)); + fLibre = pDoc->GetValue(14, i, 0); + fExcel = pDocRes->GetValue(14, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -48,8 +48,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerNested) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 5; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -64,12 +64,12 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerString) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 5; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + fLibre = pDoc->GetValue(3, i, 0); + fExcel = pDocRes->GetValue(3, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -84,8 +84,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerInEq) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 7; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + double fLibre = pDoc->GetValue(3, i, 0); + double fExcel = pDocRes->GetValue(3, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -104,8 +104,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerPrecision) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 3; ++i) { - double fOpenCL = pDoc->GetValue(ScAddress(0, i, 0)); - double fNormal = pDocRes->GetValue(ScAddress(0, i, 0)); + double fOpenCL = pDoc->GetValue(0, i, 0); + double fNormal = pDocRes->GetValue(0, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fNormal, fOpenCL, fabs(1e-14*fOpenCL)); } } @@ -123,13 +123,13 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSystematic) int nRow, nCol; for (nRow = 0; nRow < 1000; ++nRow) { - if (pDoc->GetString(ScAddress(0, nRow, 0)) == "a") + if (pDoc->GetString(0, nRow, 0) == "a") { nAVertBegin = nRow + 1; for (nCol = 0; nCol < 1000; ++nCol) { - if (pDoc->GetString(ScAddress(nCol, nRow, 0)) != "a") + if (pDoc->GetString(nCol, nRow, 0) != "a") { nAHorEnd = nCol; break; @@ -140,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSystematic) } for (; nRow < 1000; ++nRow) { - if (pDoc->GetString(ScAddress(0, nRow, 0)) != "a") + if (pDoc->GetString(0, nRow, 0) != "a") { nAVertEnd = nRow; break; @@ -149,13 +149,13 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSystematic) for (; nRow < 1000; ++nRow) { - if (pDoc->GetString(ScAddress(0, nRow, 0)) == "b") + if (pDoc->GetString(0, nRow, 0) == "b") { nBVertBegin = nRow + 1; for (nCol = 0; nCol < 1000; ++nCol) { - if (pDoc->GetString(ScAddress(nCol, nRow, 0)) != "b") + if (pDoc->GetString(nCol, nRow, 0) != "b") { nBHorEnd = nCol; break; @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSystematic) } for (; nRow < 1000; ++nRow) { - if (pDoc->GetString(ScAddress(0, nRow, 0)) != "b") + if (pDoc->GetString(0, nRow, 0) != "b") { nBVertEnd = nRow; break; @@ -186,8 +186,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSystematic) { for (int j = 1; j < nAHorEnd; ++j) { - double fLibre = pDoc->GetValue(ScAddress(j, i, 0)); - double fExcel = pDoc->GetValue(ScAddress(j, nBVertBegin + (i - nAVertBegin), 0)); + double fLibre = pDoc->GetValue(j, i, 0); + double fExcel = pDoc->GetValue(j, nBVertBegin + (i - nAVertBegin), 0); const OString sFailedMessage = OStringChar(static_cast<char>('A'+j)) + @@ -211,35 +211,35 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSharedFormulaXLS) // Check the results of formula cells in the shared formula range. for (SCROW i = 0; i < 5; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 6; i < 14; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 15; i < 18; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 19; i < 22; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 23; i < 25; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); //double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); // There seems to be a bug in LibreOffice beta ASSERT_DOUBLES_EQUAL(/*fExcel*/ 60.0, fLibre); @@ -247,33 +247,33 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSharedFormulaXLS) for (SCROW i = 25; i < 27; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 28; i < 35; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } // workaround for a Calc beta bug - ASSERT_DOUBLES_EQUAL(25.0, pDoc->GetValue(ScAddress(2, 35, 0))); - ASSERT_DOUBLES_EQUAL(24.0, pDoc->GetValue(ScAddress(2, 36, 0))); + ASSERT_DOUBLES_EQUAL(25.0, pDoc->GetValue(2, 35, 0)); + ASSERT_DOUBLES_EQUAL(24.0, pDoc->GetValue(2, 36, 0)); for (SCROW i = 38; i < 43; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } for (SCROW i = 5; i < 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(5, i, 1)); - double fExcel = pDocRes->GetValue(ScAddress(5, i, 1)); + double fLibre = pDoc->GetValue(5, i, 1); + double fExcel = pDocRes->GetValue(5, i, 1); ASSERT_DOUBLES_EQUAL(fExcel, fLibre); } @@ -281,8 +281,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testSharedFormulaXLS) { for (SCCOL j = 6; j < 11; ++j) { - double fLibre = pDoc->GetValue(ScAddress(j, i, 1)); - double fExcel = pDocRes->GetValue(ScAddress(j, i, 1)); + double fLibre = pDoc->GetValue(j, i, 1); + double fExcel = pDocRes->GetValue(j, i, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(fExcel*0.0001)); } @@ -298,8 +298,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testMathFormulaCos) for (SCROW i = 0; i <= 15; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -314,8 +314,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testMathFormulaSinh) for (SCROW i = 0; i <= 15; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -330,141 +330,141 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialFormula) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); + double fLibre = pDoc->GetValue(2,i,0); + double fExcel = pDocRes->GetValue(2,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,1)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,1)); + double fLibre = pDoc->GetValue(6,i,1); + double fExcel = pDocRes->GetValue(6,i,1); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2,i,2)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,2)); + double fLibre = pDoc->GetValue(2,i,2); + double fExcel = pDocRes->GetValue(2,i,2); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,3)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,3)); + double fLibre = pDoc->GetValue(6,i,3); + double fExcel = pDocRes->GetValue(6,i,3); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,4)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,4)); + double fLibre = pDoc->GetValue(3,i,4); + double fExcel = pDocRes->GetValue(3,i,4); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,5)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,5)); + double fLibre = pDoc->GetValue(3,i,5); + double fExcel = pDocRes->GetValue(3,i,5); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i < 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(5,i,6)); - double fExcel = pDocRes->GetValue(ScAddress(5,i,6)); + double fLibre = pDoc->GetValue(5,i,6); + double fExcel = pDocRes->GetValue(5,i,6); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,7)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,7)); + double fLibre = pDoc->GetValue(3,i,7); + double fExcel = pDocRes->GetValue(3,i,7); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,8)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,8)); + double fLibre = pDoc->GetValue(3,i,8); + double fExcel = pDocRes->GetValue(3,i,8); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,9)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,9)); + double fLibre = pDoc->GetValue(3,i,9); + double fExcel = pDocRes->GetValue(3,i,9); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2,i,10)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,10)); + double fLibre = pDoc->GetValue(2,i,10); + double fExcel = pDocRes->GetValue(2,i,10); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(7,i,11)); - double fExcel = pDocRes->GetValue(ScAddress(7,i,11)); + double fLibre = pDoc->GetValue(7,i,11); + double fExcel = pDocRes->GetValue(7,i,11); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(5,i,12)); - double fExcel = pDocRes->GetValue(ScAddress(5,i,12)); + double fLibre = pDoc->GetValue(5,i,12); + double fExcel = pDocRes->GetValue(5,i,12); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i <= 12; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,13)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,13)); + double fLibre = pDoc->GetValue(6,i,13); + double fExcel = pDocRes->GetValue(6,i,13); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,14)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,14)); + double fLibre = pDoc->GetValue(3,i,14); + double fExcel = pDocRes->GetValue(3,i,14); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,15)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,15)); + double fLibre = pDoc->GetValue(6,i,15); + double fExcel = pDocRes->GetValue(6,i,15); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,16)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,16)); + double fLibre = pDoc->GetValue(6,i,16); + double fExcel = pDocRes->GetValue(6,i,16); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 1; i <= 5; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6,i,17)); - double fExcel = pDocRes->GetValue(ScAddress(6,i,17)); + double fLibre = pDoc->GetValue(6,i,17); + double fExcel = pDocRes->GetValue(6,i,17); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,18)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,18)); + double fLibre = pDoc->GetValue(3,i,18); + double fExcel = pDocRes->GetValue(3,i,18); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } for (SCROW i = 0; i <= 18; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,19)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,19)); + double fLibre = pDoc->GetValue(3,i,19); + double fExcel = pDocRes->GetValue(3,i,19); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -479,8 +479,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaCorrel) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 20; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + double fLibre = pDoc->GetValue(3, i, 0); + double fExcel = pDocRes->GetValue(3, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -494,8 +494,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaFisher) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -510,8 +510,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaFisherInv) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -526,8 +526,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaGamma) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -541,8 +541,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialFvscheduleFormula) for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -557,8 +557,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testMathFormulaAbs) // Verify ABS Function for (SCROW i = 1; i <= 1000; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -572,8 +572,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialSYDFormula) for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); + double fLibre = pDoc->GetValue(4, i, 0); + double fExcel = pDocRes->GetValue(4, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -589,8 +589,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialIRRFormula) for (SCROW i = 0; i <= 6; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -606,8 +606,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaGammaLn) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -622,8 +622,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaGauss) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -638,8 +638,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaGeoMean) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -654,8 +654,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaHarMean) // Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i) { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + double fLibre = pDoc->GetValue(1,i,0); + double fExcel = pDocRes->GetValue(1,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -669,8 +669,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialSLNFormula) for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + double fLibre = pDoc->GetValue(3, i, 0); + double fExcel = pDocRes->GetValue(3, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -684,8 +684,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialMIRRFormula) for (SCROW i = 0; i <= 6; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + double fLibre = pDoc->GetValue(3, i, 0); + double fExcel = pDocRes->GetValue(3, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -699,8 +699,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinancialCoupdaybsFormula) for (SCROW i = 1; i <=10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); + double fLibre = pDoc->GetValue(4, i, 0); + double fExcel = pDocRes->GetValue(4, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -714,8 +714,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialDollardeFormula) for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + double fLibre = pDoc->GetValue(2, i, 0); + double fExcel = pDocRes->GetValue(2, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -729,8 +729,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinancialCoupdaysFormula) for (SCROW i = 1; i <=10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); + double fLibre = pDoc->GetValue(4, i, 0); + double fExcel = pDocRes->GetValue(4, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } @@ -745,8 +745,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinancialCoupdaysncFormula) for (SCROW i = 1; i <=10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); + double fLibre = pDoc->GetValue(4, i, 0); + double fExcel = pDocRes->GetValue(4, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -759,8 +759,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinacialRateFormula) for (SCROW i = 1; i <= 5; ++i) { - double fLibre = pDoc->GetValue(ScAddress(6, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(6, i, 0)); + double fLibre = pDoc->GetValue(6, i, 0); + double fExcel = pDocRes->GetValue(6, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -774,8 +774,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinancialAccrintmFormula) for (SCROW i = 1; i <= 10; ++i) { - double fLibre = pDoc->GetValue(ScAddress(5, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(5, i, 0)); + double fLibre = pDoc->GetValue(5, i, 0); + double fExcel = pDocRes->GetValue(5, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -789,8 +789,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testFinancialCoupnumFormula) for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); + double fLibre = pDoc->GetValue(4, i, 0); + double fExcel = pDocRes->GetValue(4, i, 0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } @@ -805,8 +805,8 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaNegbinomdist) // Check the results of formula cells in the shared formula range. for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); + double fLibre = pDoc->GetValue(3,i,0); + double fExcel = pDocRes->GetValue(3,i,0); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } }
