[Libreoffice-commits] core.git: sc/qa
Eike Rathke
erack at redhat.com
Wed Oct 28 15:38:47 PDT 2015
sc/qa/unit/ucalc_formula.cxx | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
New commits:
commit 9d28748d4b6d97bf0d18956e9e0336d71d9fc718
Author: Eike Rathke <erack at redhat.com>
Date: Wed Oct 28 23:34:39 2015 +0100
unit test for tdf#95395
Change-Id: I8bbd70f6740019bebc23d20259f923b8f87d4329
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index c9815a7..6972517 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -4188,6 +4188,29 @@ void Test::testFuncVLOOKUP()
m_pDoc->SetString(ScAddress(2,0,0), "=VLOOKUP(\"C\";A1:A16;1)");
CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(2,0,0)));
+
+ // A21:E24, test position dependent implicit intersection as argument to a
+ // scalar value parameter in a function that has a ReferenceOrForceArray
+ // type parameter somewhere else and formula is not in array mode,
+ // VLOOKUP(Value;ReferenceOrForceArray;...)
+ const char* aData2[][5] = {
+ { "1", "one", "3", "=VLOOKUP(C21:C24;A21:B24;2;0)", "three" },
+ { "2", "two", "1", "=VLOOKUP(C21:C24;A21:B24;2;0)", "one" },
+ { "3", "three", "4", "=VLOOKUP(C21:C24;A21:B24;2;0)", "four" },
+ { "4", "four", "2", "=VLOOKUP(C21:C24;A21:B24;2;0)", "two" }
+ };
+
+ ScAddress aPos2(0,20,0);
+ ScRange aRange2 = insertRangeData(m_pDoc, aPos2, aData2, SAL_N_ELEMENTS(aData2));
+ CPPUNIT_ASSERT(aRange2.aStart == aPos2);
+
+ aPos2.SetCol(3); // column D formula results
+ for (size_t i=0; i < SAL_N_ELEMENTS(aData2); ++i)
+ {
+ CPPUNIT_ASSERT_EQUAL( OUString::createFromAscii( aData2[i][4]), m_pDoc->GetString(aPos2));
+ aPos2.IncRow();
+ }
+
m_pDoc->DeleteTab(0);
}
More information about the Libreoffice-commits
mailing list