diff options
author | Eike Rathke <erack@redhat.com> | 2015-08-26 13:14:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-08-26 21:00:34 +0200 |
commit | a7e273755095e4b97c05a63ab39aa09f8aa755a4 (patch) | |
tree | 57545b298d66456ca00a0ab61159049bc6ecd079 | |
parent | 56238d58a7da705e4e91604964e6564d819a9196 (diff) |
unit test that parsing range fragments should fail
Change-Id: Iff5ef2a5b2315b19cf8f0e84a08c776c3c97e0ae
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 8a5d76622c79..0e379f125edc 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -321,6 +321,39 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal); ScRange aRange; + + aRange.aStart.SetTab(0); + nRes = aRange.Parse(":B", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse("B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse(":B2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse("B2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse(":2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse("2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse(":2B", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + + aRange.aStart.SetTab(0); + nRes = aRange.Parse("2B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); + aRange.aStart.SetTab(0); nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & SCA_VALID) != 0); |