summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 6c1ab7554900..a19e300da250 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -640,6 +640,24 @@ void Test::testMatrix()
pMat->And() && pMat->Or());
}
+ // Test the AND and OR evaluations.
+ for (int i = 0; i < 2; ++i)
+ {
+ pMat = new ScMatrix(2, 2, eDT[i]);
+
+ // Only some of the elements are non-zero.
+ pMat->PutBoolean(true, 0, 0);
+ pMat->PutDouble(1.0, 1, 1);
+ CPPUNIT_ASSERT_MESSAGE("incorrect OR result", pMat->Or());
+ CPPUNIT_ASSERT_MESSAGE("incorrect AND result", !pMat->And());
+
+ // All of the elements are non-zero.
+ pMat->PutBoolean(true, 0, 1);
+ pMat->PutDouble(2.3, 1, 0);
+ CPPUNIT_ASSERT_MESSAGE("incorrect OR result", pMat->Or());
+ CPPUNIT_ASSERT_MESSAGE("incorrect AND result", pMat->And());
+ }
+
// Now test the emtpy matrix types.
eDT[0] = ScMatrix::FILLED_EMPTY;
eDT[1] = ScMatrix::SPARSE_EMPTY;