diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-03-19 11:52:14 +0000 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-19 13:40:25 -0400 |
commit | 9d269e1820efc532a0271f04505c590805a6c48b (patch) | |
tree | 90d92644cd6c18a36189f1d84a9814e758d45559 /sc/qa | |
parent | b13550ed57ec438a57f6482d9ea6d16f354eec14 (diff) |
use cell hashing algorithm for computing groups.
Update unit tests, dumb-down hashing to compare more for similiarity
rather than identicality - we want to use this down columns.
Change-Id: Icea731daeb301e1febb2df48b6b46c9faba74e9d
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 63b740b9b1a8..81fa1ea4d720 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1222,6 +1222,13 @@ void Test::testFormulaHashAndTag() { "=X20", "=X$20", false }, // absolute vs relative { "=X20", "=$X20", false }, // absolute vs relative { "=X$20", "=$X20", false }, // column absolute vs row absolute + // similar enough for merging ... + { "=A1", "=B1", true }, + { "=$A$1", "=$B$1", true }, + { "=A1", "=C2", true }, + { "=SUM(A1)", "=SUM(B1)", true }, + { "=A1+3", "=B1+3", true }, + { "=A1+7", "=B1+42", false }, }; for (size_t i = 0; i < SAL_N_ELEMENTS(aHashTests); ++i) @@ -6221,14 +6228,14 @@ void Test::testFormulaGrouping() const char *pFormula[3]; const bool bGroup[3]; } aGroupTests[] = { - { { "=B1", "=C1", "" }, // single increments - { true, true, false } }, - { { "=B1", "=D1", "=F1" }, // tripple increments - { true, true, true } }, - { { "=B1", "", "=C1" }, // a gap - { false, false, false } }, - { { "=B1", "=C1+3", "=C1+D1" }, // confusion: FIXME: =C1+7 - { false, false, false } }, + { { "=SUM(B1)", "=SUM(C1)", "" }, // single increments + { true, true, false } }, + { { "=SUM(B1)", "=SUM(D1)", "=SUM(F1)" }, // tripple increments + { true, true, true } }, + { { "=SUM(B1)", "", "=SUM(C1)" }, // a gap + { false, false, false } }, + { { "=SUM(B1)", "=SUM(C1;3)", "=SUM(D1;3)" }, // similar foo + { false, true, true } }, }; m_pDoc->InsertTab( 0, "sheet" ); @@ -6259,7 +6266,7 @@ void Test::testFormulaGrouping() if( !!pCur->GetCellGroup().get() ^ aGroupTests[i].bGroup[j] ) { printf("expected group test %d at row %d to be %d but is %d\n", - i, j, !!pCur->GetCellGroup().get(), aGroupTests[i].bGroup[j]); + i, j, aGroupTests[i].bGroup[j], !!pCur->GetCellGroup().get()); CPPUNIT_ASSERT_MESSAGE("Failed", false); } } |