summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-11 18:51:04 +0100
committerEike Rathke <erack@redhat.com>2014-12-11 18:54:51 +0100
commit6c41a1272e43a3e3b785724991837b597dbf00ef (patch)
treef54c60f85411f524f3ba8c9eed5f2aa8f441ebcf /sc/qa
parentc69f481d792c7b121479d024cf675f6ddb747422 (diff)
unit test for matrix comparison error propagation, fdo#87237
Change-Id: Id02f169b111945673a16d0c852940c805aa89319
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc.cxx22
-rw-r--r--sc/qa/unit/ucalc.hxx2
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b35bc1186ff3..029db9dfedf8 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1961,6 +1961,28 @@ void Test::testMatrix()
}
}
+void Test::testMatrixComparisonWithErrors()
+{
+ m_pDoc->InsertTab(0, "foo");
+
+ // Insert the source values in A1:A2.
+ m_pDoc->SetString(0, 0, 0, "=1/0");
+ m_pDoc->SetValue( 0, 1, 0, 1.0);
+
+ // Create a matrix formula in B3:B4 referencing A1:A2 and doing a greater
+ // than comparison on it's values. Error value must be propagated.
+ ScMarkData aMark;
+ aMark.SelectOneTable(0);
+ m_pDoc->InsertMatrixFormula(1, 2, 1, 3, aMark, "=A1:A2>0");
+
+ CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), m_pDoc->GetString(0,0,0));
+ CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue( 0,1,0));
+ CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), m_pDoc->GetString(1,2,0));
+ CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), m_pDoc->GetString(1,3,0));
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testEnterMixedMatrix()
{
m_pDoc->InsertTab(0, "foo");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 81d8788c572f..b2332743f4e5 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -215,6 +215,7 @@ public:
void testInsertNameList();
void testCSV();
void testMatrix();
+ void testMatrixComparisonWithErrors();
void testEnterMixedMatrix();
void testMatrixEditable();
@@ -500,6 +501,7 @@ public:
CPPUNIT_TEST(testInsertNameList);
CPPUNIT_TEST(testCSV);
CPPUNIT_TEST(testMatrix);
+ CPPUNIT_TEST(testMatrixComparisonWithErrors);
CPPUNIT_TEST(testEnterMixedMatrix);
CPPUNIT_TEST(testMatrixEditable);
CPPUNIT_TEST(testPivotTable);