[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/qa

Kohei Yoshida kohei.yoshida at gmail.com
Mon Jul 15 16:05:05 PDT 2013


 sc/qa/unit/ucalc.cxx |   62 ---------------------------------------------------
 sc/qa/unit/ucalc.hxx |    5 ----
 2 files changed, 67 deletions(-)

New commits:
commit 8cfbad25dc7772a528ac6866adfe69b29fc78407
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Jul 15 19:04:52 2013 -0400

    We don't need this test any more.
    
    We have tests for in-place grouping of formula cells in ucalc_sharedformula.
    
    Change-Id: I04ca2e53bc7351084cac5d0bf609f1bdb2a25066

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b3ddaff..fb34ca3 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3935,68 +3935,6 @@ void Test::testCellTextWidth()
     m_pDoc->DeleteTab(0);
 }
 
-void Test::testFormulaGrouping()
-{
-    if ( !getenv("SC_FORMULAGROUP") )
-        return;
-
-    static const struct {
-        const char *pFormula[3];
-        bool  bGroup[3];
-    } aGroupTests[] = {
-        { { "=B1", "=B2", "" }, // relative reference
-          { true, true, false } },
-        { { "=B1", "=B2", "=B3" },
-          { true, true, true } },
-        { { "=B1", "", "=B3" }, // a gap
-          { false, false, false } },
-        { { "=$B$1", "=$B$1", "" }, // absolute reference
-          { true, true, false } },
-        { { "=$Z$10", "=$Z$10", "=$Z$10" },
-          { true, true, true } },
-        { { "=C1+$Z$10", "=C2+$Z$10", "=C3+$Z$10" }, // mixture
-          { true, true, true } },
-        { { "=C1+$Z$11", "=C2+$Z$12", "=C3+$Z$12" }, // mixture
-          { false, true, true } },
-        { { "=SUM(B1)",  "", "=SUM(B3)" },    // a gap
-          { false, false, false } },
-    };
-
-    m_pDoc->InsertTab( 0, "sheet" );
-
-    for (size_t i = 0; i < SAL_N_ELEMENTS(aGroupTests); ++i)
-    {
-        for (size_t j = 0; j < SAL_N_ELEMENTS(aGroupTests[0].pFormula); ++j)
-        {
-            OUString aFormula = OUString::createFromAscii(aGroupTests[i].pFormula[j]);
-            m_pDoc->SetString(0, static_cast<SCROW>(j), 0, aFormula);
-        }
-        m_pDoc->RebuildFormulaGroups();
-
-        for (size_t j = 0; j < SAL_N_ELEMENTS(aGroupTests[0].pFormula); ++j)
-        {
-            ScRefCellValue aCell;
-            aCell.assign(*m_pDoc, ScAddress(0, static_cast<SCROW>(j), 0));
-            if (aCell.isEmpty())
-            {
-                CPPUNIT_ASSERT_MESSAGE("invalid empty cell", !aGroupTests[i].bGroup[j]);
-                continue;
-            }
-            CPPUNIT_ASSERT_MESSAGE("Cell expected, but not there.", !aCell.isEmpty());
-            CPPUNIT_ASSERT_MESSAGE("Cell wrong type.",
-                                   aCell.meType == CELLTYPE_FORMULA);
-            ScFormulaCell *pCur = aCell.mpFormula;
-
-            if( !!pCur->GetCellGroup().get() ^ aGroupTests[i].bGroup[j] )
-            {
-                cout << "expected group test " << i << " at row " << j << " to be "
-                    << aGroupTests[i].bGroup[j] << " but is " << !!pCur->GetCellGroup().get() << endl;
-                CPPUNIT_FAIL("Failed");
-            }
-        }
-    }
-}
-
 void Test::testCondFormatINSDEL()
 {
     // fdo#62206
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 8c4edcf..43b10a9 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -257,10 +257,6 @@ public:
     void testAnchoredRotatedShape();
     void testCellTextWidth();
 
-    /**
-     * Test formula & formula grouping
-     */
-    void testFormulaGrouping();
     void testCondFormatINSDEL();
 
     CPPUNIT_TEST_SUITE(Test);
@@ -345,7 +341,6 @@ public:
     CPPUNIT_TEST(testDeleteCol);
     CPPUNIT_TEST(testAnchoredRotatedShape);
     CPPUNIT_TEST(testCellTextWidth);
-    CPPUNIT_TEST(testFormulaGrouping);
     CPPUNIT_TEST(testCondFormatINSDEL);
     CPPUNIT_TEST_SUITE_END();
 


More information about the Libreoffice-commits mailing list