summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-22 14:57:28 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-22 14:58:53 -0500
commit264e5034688a9c3105b3d29c7083ef2565afaec6 (patch)
tree1710dc50249160320e2fbda1a8a65b4890dd4fd7 /sc/qa/unit
parent543d3bf035ea42cf7b16f394e58795f532a69151 (diff)
fdo#43154: Fixed incorrectly query validation.
It was due to a simple mis-placement of an operator. No idea how the compiler may have parsed that statement...
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/ucalc.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c4848c2b2ed7..975737a17bbd 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -433,6 +433,18 @@ void testFuncCOUNTIF(ScDocument* pDoc)
CPPUNIT_ASSERT_MESSAGE("Unexpected result for COUNTIF", false);
}
}
+
+ // Don't count empty strings when searching for a number.
+
+ // Clear A1:A2.
+ clearRange(pDoc, ScRange(0, 0, 0, 0, 1, 0));
+
+ pDoc->SetString(0, 0, 0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=\"\"")));
+ pDoc->SetString(0, 1, 0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=COUNTIF(A1;1)")));
+ pDoc->CalcAll();
+
+ double result = pDoc->GetValue(0, 1, 0);
+ CPPUNIT_ASSERT_MESSAGE("We shouldn't count empty string as valid number.", result == 0.0);
}
void testFuncVLOOKUP(ScDocument* pDoc)