#include"helper/qahelper.hxx"// contains class ScModelTestBase
#include <sfx2/dispatch.hxx>
usingnamespace css;
class ScInlineArray : public ScModelTestBase
{ public:
ScInlineArray()
: ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
};
/* These tests cover cases that use inline arrays. The actual visible separators depend on user settings.Thedefaultofthesesettingsdependonlocal.ThemarkupintheODFfileusesthe semicolonascolumnseparatorandthepipesymbolasrowseparator.Theseseparatorsareused
in below comments.*/
CPPUNIT_TEST_FIXTURE(ScInlineArray, testLOOKUP_special)
{ // LOOKUP has some special rules. These are tested here.
// Load a document with test cases and force recalculation.
createScDoc("ods/LOOKUP_inlineArray.ods");
dispatchCommand(mxComponent, u".uno:CalculateHard"_ustr, {});
ScDocument* pDoc = getScDoc();
// Test results. Explanations can be found in the test file.
CPPUNIT_ASSERT_EQUAL(u"Y"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(1, 2, 0)));
CPPUNIT_ASSERT_EQUAL(u"Z"_ustr, pDoc->GetString(ScAddress(1, 5, 0)));
CPPUNIT_ASSERT_EQUAL(u"10"_ustr, pDoc->GetString(ScAddress(1, 6, 0)));
CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(1, 8, 0)));
CPPUNIT_ASSERT_EQUAL(u"200"_ustr, pDoc->GetString(ScAddress(1, 11, 0)));
CPPUNIT_ASSERT_EQUAL(u"200"_ustr, pDoc->GetString(ScAddress(1, 12, 0)));
CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(1, 13, 0)));
}
CPPUNIT_TEST_FIXTURE(ScInlineArray, testTdf67134)
{ // Search and result array in LOOKUP need not have the same direction. // This also applies to inline arrays. // Before the fix the #N/A error was returned in case of different directions.
// Load a document with test cases and force recalculation.
createScDoc("ods/tdf167134_LOOKUP_inlineArray.ods");
dispatchCommand(mxComponent, u".uno:CalculateHard"_ustr, {});
ScDocument* pDoc = getScDoc();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.