summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-01-12 01:08:34 +0100
committerEike Rathke <erack@redhat.com>2013-01-12 01:09:04 +0100
commit16ab898a4139ab1743f68caec86aaa2fb2ba10e0 (patch)
treef1fecdf750a29f686c5b1eaf68b414609a6d76d2
parentc34ca5c2a638476b76ae448b16a13358fd2be926 (diff)
at least use correct test data ...
Change-Id: Icb5bb61108f6bb674016ce044ecbe6a366b4f9c6
-rw-r--r--sc/qa/unit/ucalc.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a12ce890b49a..14d0da128da7 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -678,7 +678,7 @@ void testFuncIFERROR(ScDocument* pDoc)
// Empty A1:A39 first.
clearRange(pDoc, ScRange(0, 0, 0, 0, 40, 0));
- // Raw data (rows 1 through 10)
+ // Raw data (rows 1 through 12)
const char* aData[] = {
"1",
"e",
@@ -689,23 +689,23 @@ void testFuncIFERROR(ScDocument* pDoc)
"=NA()",
"bar",
"4",
- "gee"
+ "gee",
+ "=1/0",
+ "23"
};
SCROW nRows = SAL_N_ELEMENTS(aData);
for (SCROW i = 0; i < nRows; ++i)
pDoc->SetString(0, i, 0, rtl::OUString::createFromAscii(aData[i]));
- printRange(pDoc, ScRange(0, 0, 0, 0, 8, 0), "data range for IFERROR/IFNA");
+ printRange(pDoc, ScRange(0, 0, 0, 0, nRows-1, 0), "data range for IFERROR/IFNA");
// formulas and results
struct {
const char* pFormula; const char* pResult;
} aChecks[] = {
{ "=IFERROR(A1;9)", "1" },
- // { "{=IFERROR(3*A1:A2;2002)}", "3" },
- // { "{=IFERROR(3*A1:A2;1998)}", "1998" },
- // { "=IFERROR(A2;-7)", "-7" },
+ { "=IFERROR(A2;9)", "e" },
{ "=IFERROR(A3;9)", "2" },
{ "=IFERROR(A4;-7)", "-7" },
{ "=IFERROR(A5;-7)", "-7" },
@@ -713,16 +713,25 @@ void testFuncIFERROR(ScDocument* pDoc)
{ "=IFERROR(A7;-7)", "-7" },
{ "=IFNA(A6;9)", "#DIV/0!" },
{ "=IFNA(A7;-7)", "-7" },
- // { "=IFNA(VLOOKUP(\"4\",A8:A10;1;0);-2)", "4" },
- // { "=IFNA(VLOOKUP(\"fop\",A8:A10;1;0);-2)", "-2" }
+ { "=IFNA(VLOOKUP(\"4\";A8:A10;1;0);-2)", "4" },
+ { "=IFNA(VLOOKUP(\"fop\";A8:A10;1;0);-2)", "-2" },
+ { "{=IFERROR(3*A11:A12;1998)}[0]", "1998" }, // um.. this is not the correct way to insert a
+ { "{=IFERROR(3*A11:A12;1998)}[1]", "69" } // matrix formula, just a place holder, see below
};
nRows = SAL_N_ELEMENTS(aChecks);
- for (SCROW i = 0; i < nRows; ++i)
+ for (SCROW i = 0; i < nRows-2; ++i)
{
SCROW nRow = 20 + i;
pDoc->SetString(0, nRow, 0, rtl::OUString::createFromAscii(aChecks[i].pFormula));
}
+
+ // Create a matrix range in last two rows of the range above, actual data
+ // of the placeholders.
+ ScMarkData aMark;
+ aMark.SelectOneTable(0);
+ pDoc->InsertMatrixFormula(0, 20 + nRows-2, 0, 20 + nRows-1, aMark, "=IFERROR(3*A11:A12;1998)", NULL);
+
pDoc->CalcAll();
for (SCROW i = 0; i < nRows; ++i)