diff options
author | Eike Rathke <erack@redhat.com> | 2015-06-30 15:36:37 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-06-30 15:39:54 +0200 |
commit | 26d1a597a4c2258b652434856198c0ee8e1af87f (patch) | |
tree | d9164aae435feb7ae339440f5597422b4bd8fdd8 | |
parent | 02d3ae938d92988bb24b370ca0beece17bb275fa (diff) |
unit test, check for all ScRange::Parse() valid flags, tdf#92426
Change-Id: I9c941cfcb8c856f35ff3b24f8e15000af4993651
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index d1b4b26ad857..0e562d733a52 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -330,6 +330,10 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aEnd.Col()); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row()); + CPPUNIT_ASSERT_EQUAL(nRes & (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2), + (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2)); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE), 0); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE), (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE)); @@ -342,6 +346,10 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(MAXCOL), aRange.aEnd.Col()); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aEnd.Row()); + CPPUNIT_ASSERT_EQUAL(nRes & (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2), + (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2)); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE), 0); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE), (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE)); @@ -353,6 +361,10 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aRange.aEnd.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(2), aRange.aEnd.Col()); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row()); + CPPUNIT_ASSERT_EQUAL(nRes & (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2), + (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2)); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE), 0); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE), (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE)); @@ -366,6 +378,10 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aEnd.Col()); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row()); + CPPUNIT_ASSERT_EQUAL(nRes & (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2), + (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2)); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE), 0); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE), (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE)); @@ -379,6 +395,10 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(MAXCOL), aRange.aEnd.Col()); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aEnd.Row()); + CPPUNIT_ASSERT_EQUAL(nRes & (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2), + (SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | + SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2)); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_ROW_ABSOLUTE | SCA_ROW2_ABSOLUTE), 0); CPPUNIT_ASSERT_EQUAL(nRes & (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE), (SCA_COL_ABSOLUTE | SCA_COL2_ABSOLUTE)); |