diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-10-16 20:49:07 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-10-16 20:50:55 -0400 |
commit | 9d8f1795836f58cb275eae19818eb25ee80901a0 (patch) | |
tree | 1048bbcde60654c6324bd8bedabb47e174462411 | |
parent | 15c944513b935d6a38be6487f14687627815696d (diff) |
fdo#73080: Write another test case for single cell reference cases.
Change-Id: I8dff6850c7088b483d1ad669867da6cef454d9a2
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 5c5d6b06c0c0..afa12616a638 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -2538,6 +2538,27 @@ void Test::testFuncCOUNTBLANK() CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(2,5,0))); CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(3,5,0))); + // Test single cell reference cases. + + clearSheet(m_pDoc, 0); + + const char* aData2[][2] = { + { "1", "=COUNTBLANK(A1)" }, + { "A", "=COUNTBLANK(A2)" }, + { 0, "=COUNTBLANK(A3)" }, + { "=\"\"", "=COUNTBLANK(A4)" }, + { "=A4" , "=COUNTBLANK(A5)" }, + }; + + aRange = insertRangeData(m_pDoc, aPos, aData2, SAL_N_ELEMENTS(aData2)); + CPPUNIT_ASSERT(aRange.aStart == aPos); + + CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(1,0,0))); + CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(1,1,0))); + CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,2,0))); + CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,3,0))); + CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,4,0))); + m_pDoc->DeleteTab(0); } |