diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2018-02-17 09:29:02 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2018-02-17 21:05:13 +0100 |
commit | cf9e55538375e5c5dea173151f1d0386bd29ad4e (patch) | |
tree | d4c87c3ba939bd7f8cbfe4d495b3fbe769fe7f1d /sc | |
parent | 1c791a9b28af5e6ece46e1d48a2acde9d4c81c78 (diff) |
Use the variant of checkOutput that takes nested std::vector.
That one is *the* future. We can't remove the old one just yet...
Change-Id: I3c5b1bfee3d2cb8988b68ced5a38d52d641e5881
Reviewed-on: https://gerrit.libreoffice.org/49908
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 16 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 20 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_sort.cxx | 52 |
3 files changed, 44 insertions, 44 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 7651a65a448f..29c16f6e8243 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6028,7 +6028,7 @@ void Test::testFormulaToValue() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "2", "TRUE" }, { "2", "4", "TRUE" }, { "3", "6", "TRUE" }, @@ -6037,7 +6037,7 @@ void Test::testFormulaToValue() { "6", "12", "TRUE" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Initial value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -6048,7 +6048,7 @@ void Test::testFormulaToValue() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "2", "TRUE" }, { "2", "4", "TRUE" }, { "3", "6", "FALSE" }, @@ -6057,7 +6057,7 @@ void Test::testFormulaToValue() { "6", "12", "TRUE" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Converted"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Converted"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -6090,7 +6090,7 @@ void Test::testFormulaToValue() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "2", "TRUE" }, { "2", "4", "TRUE" }, { "3", "6", "TRUE" }, @@ -6099,7 +6099,7 @@ void Test::testFormulaToValue() { "6", "12", "TRUE" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "After undo"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After undo"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -6121,7 +6121,7 @@ void Test::testFormulaToValue() pUndoMgr->Redo(); { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "2", "TRUE" }, { "2", "4", "TRUE" }, { "3", "6", "FALSE" }, @@ -6130,7 +6130,7 @@ void Test::testFormulaToValue() { "6", "12", "TRUE" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Converted"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Converted"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index d6764c498e51..a67ef5063dcd 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5683,7 +5683,7 @@ void Test::testFormulaDepTrackingDeleteCol() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][2] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "#REF!", "#REF!" }, { nullptr, nullptr }, { "#REF!", "#REF!" }, @@ -5691,7 +5691,7 @@ void Test::testFormulaDepTrackingDeleteCol() }; ScRange aCheckRange(0,0,0,1,3,0); - bool bSuccess = checkOutput<2>(m_pDoc, aCheckRange, aOutputCheck, "Check after deleting column A"); + bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check after deleting column A"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -5702,7 +5702,7 @@ void Test::testFormulaDepTrackingDeleteCol() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "2", "2", "2" }, { nullptr, nullptr, nullptr }, { "3", "3", "3" }, @@ -5710,7 +5710,7 @@ void Test::testFormulaDepTrackingDeleteCol() }; ScRange aCheckRange(0,0,0,2,3,0); - bool bSuccess = checkOutput<3>(m_pDoc, aCheckRange, aOutputCheck, "Check after undo"); + bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check after undo"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -5718,7 +5718,7 @@ void Test::testFormulaDepTrackingDeleteCol() pUndoMgr->Redo(); { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][2] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "#REF!", "#REF!" }, { nullptr, nullptr }, { "#REF!", "#REF!" }, @@ -5726,7 +5726,7 @@ void Test::testFormulaDepTrackingDeleteCol() }; ScRange aCheckRange(0,0,0,1,3,0); - bool bSuccess = checkOutput<2>(m_pDoc, aCheckRange, aOutputCheck, "Check after redo"); + bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check after redo"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -5738,7 +5738,7 @@ void Test::testFormulaDepTrackingDeleteCol() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "22", "22", "22" }, { nullptr, nullptr, nullptr }, { "23", "23", "23" }, @@ -5746,7 +5746,7 @@ void Test::testFormulaDepTrackingDeleteCol() }; ScRange aCheckRange(0,0,0,2,3,0); - bool bSuccess = checkOutput<3>(m_pDoc, aCheckRange, aOutputCheck, "Check after undo & value change in column A"); + bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check after undo & value change in column A"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -6203,7 +6203,7 @@ void Test::testExternalRefUnresolved() ScRange aRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); CPPUNIT_ASSERT_EQUAL(aPos, aRange.aStart); - const char* aOutputCheck[][1] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "#REF!" }, // plain single ref { "#REF!" }, // +23 { "#REF!" }, // &"W" @@ -6234,7 +6234,7 @@ void Test::testExternalRefUnresolved() { "#REF!" }, // INDIRECT }; - bool bSuccess = checkOutput<1>(m_pDoc, aRange, aOutputCheck, "Check unresolved external reference."); + bool bSuccess = checkOutput(m_pDoc, aRange, aOutputCheck, "Check unresolved external reference."); CPPUNIT_ASSERT_MESSAGE("Unresolved reference check failed", bSuccess); m_pDoc->DeleteTab(0); diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index e700c5e4ffe2..825c608f3643 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -177,14 +177,14 @@ void Test::testSortHorizontal() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][4] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "table", "flag", "has UNIQUE", "Publish to EC2" }, { "w2gi.mobilehit", "Yes-No", "Yes", "No" }, { "w2gi.visitors", "No-No", "No", "No" }, { "w2gi.pagedimension", "Yes-Yes", "Yes", "Yes" }, }; - bool bSuccess = checkOutput<4>(m_pDoc, aDataRange, aOutputCheck, "Sorted by column with formula"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted by column with formula"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1354,14 +1354,14 @@ void Test::testSortRefUpdate6() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "1" }, { "9", "1", "2" }, { "1", "2", "4" }, { "8", "3", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Initial value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1386,14 +1386,14 @@ void Test::testSortRefUpdate6() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "1" }, { "1", "2", "3" }, { "8", "3", "6" }, { "9", "1", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1410,14 +1410,14 @@ void Test::testSortRefUpdate6() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "1" }, { "9", "1", "2" }, { "1", "2", "4" }, { "8", "3", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "After undo"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After undo"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1425,14 +1425,14 @@ void Test::testSortRefUpdate6() pUndoMgr->Redo(); { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "1" }, { "1", "2", "3" }, { "8", "3", "6" }, { "9", "1", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "After redo"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After redo"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1441,14 +1441,14 @@ void Test::testSortRefUpdate6() rFunc.SetValueCell(ScAddress(2,0,0), 11.0, false); { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "11" }, { "1", "2", "13" }, { "8", "3", "16" }, { "9", "1", "17" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Change the header value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Change the header value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1456,14 +1456,14 @@ void Test::testSortRefUpdate6() pUndoMgr->Undo(); { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "Order", "Value", "1" }, { "1", "2", "3" }, { "8", "3", "6" }, { "9", "1", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "After undo of header value change"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After undo of header value change"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1491,12 +1491,12 @@ void Test::testSortBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][7] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", nullptr, nullptr, "0", "0", "1", "1" }, { "2", "8", nullptr, "8", "8", "10", "10" }, }; - bool bSuccess = checkOutput<7>(m_pDoc, aDataRange, aOutputCheck, "Initial value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1522,12 +1522,12 @@ void Test::testSortBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][7] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "2", "8", nullptr, "8", "8", "10", "10" }, { "1", nullptr, nullptr, "0", "0", "1", "1" }, }; - bool bSuccess = checkOutput<7>(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1583,7 +1583,7 @@ void Test::testSortBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][2] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "2" }, { nullptr, "8" }, { nullptr, nullptr }, @@ -1593,7 +1593,7 @@ void Test::testSortBroadcaster() { "1", "10" }, }; - bool bSuccess = checkOutput<2>(m_pDoc, aDataRange, aOutputCheck, "Initial value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1619,7 +1619,7 @@ void Test::testSortBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][2] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "2", "1" }, { "8", nullptr }, { nullptr, nullptr }, @@ -1629,7 +1629,7 @@ void Test::testSortBroadcaster() { "10", "1" }, }; - bool bSuccess = checkOutput<2>(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1691,12 +1691,12 @@ void Test::testSortBroadcastBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "1", "1", "1" }, { "2", "2", "2" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Initial value"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial value"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } @@ -1722,12 +1722,12 @@ void Test::testSortBroadcastBroadcaster() { // Expected output table content. 0 = empty cell - const char* aOutputCheck[][3] = { + std::vector<std::vector<const char*>> aOutputCheck = { { "2", "2", "2" }, { "1", "1", "1" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); + bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } |