Kaydet (Commit) 18a2a642 authored tarafından Eike Rathke's avatar Eike Rathke

unit test that parsing range fragments should fail

Change-Id: Iff5ef2a5b2315b19cf8f0e84a08c776c3c97e0ae
üst ed6209f5
...@@ -321,6 +321,39 @@ void Test::testFormulaParseReference() ...@@ -321,6 +321,39 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal); CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal);
ScRange aRange; 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); aRange.aStart.SetTab(0);
nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO); nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & SCA_VALID) != 0); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & SCA_VALID) != 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment