From 0b3f0f0bad8752c2ff2a1933ced57874ee846805 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 27 Oct 2014 08:53:33 -0700 Subject: [PATCH] fdo#85215: Write test for this. Change-Id: I789da5d81e6211ed8f5fae1e293833bde5ce375b --- sc/qa/unit/ucalc_sort.cxx | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index d0997c350131..a1189dd023a4 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1430,7 +1431,38 @@ void Test::testSortRefUpdate6() { "9", "1", "7" }, }; - bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Sorted without reference update"); + bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "After redo"); + CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); + } + + // Change the value of C1 and make sure the formula broadcasting chain still works. + ScDocFunc& rFunc = getDocShell().GetDocFunc(); + rFunc.SetValueCell(ScAddress(2,0,0), 11.0, false); + { + // Expected output table content. 0 = empty cell + const char* aOutputCheck[][3] = { + { "Order", "Value", "11" }, + { "1", "2", "13" }, + { "8", "3", "16" }, + { "9", "1", "17" }, + }; + + bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, "Change the header value"); + CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); + } + + // Undo and check. + pUndoMgr->Undo(); + { + // Expected output table content. 0 = empty cell + const char* aOutputCheck[][3] = { + { "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"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); }