summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-10-16 20:49:07 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-10-16 20:50:55 -0400
commit9d8f1795836f58cb275eae19818eb25ee80901a0 (patch)
tree1048bbcde60654c6324bd8bedabb47e174462411 /sc/qa
parent15c944513b935d6a38be6487f14687627815696d (diff)
fdo#73080: Write another test case for single cell reference cases.
Change-Id: I8dff6850c7088b483d1ad669867da6cef454d9a2
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx21
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);
}