Kaydet (Commit) d60c14cd authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add a new import filter test case for data table from xls.

Data Table is in Data -> Table in Excel XP, and is under "What-if Analysis"
in 2007 and newer.

Change-Id: Iec1f944a8643bafb71341981bf94c6c536c63484
üst e4171321
...@@ -110,6 +110,7 @@ public: ...@@ -110,6 +110,7 @@ public:
void testMergedCellsODS(); void testMergedCellsODS();
void testRepeatedColumnsODS(); void testRepeatedColumnsODS();
void testDataValidityODS(); void testDataValidityODS();
void testDataTableXLS();
void testDataBarODS(); void testDataBarODS();
void testDataBarXLSX(); void testDataBarXLSX();
...@@ -171,6 +172,7 @@ public: ...@@ -171,6 +172,7 @@ public:
CPPUNIT_TEST(testMergedCellsODS); CPPUNIT_TEST(testMergedCellsODS);
CPPUNIT_TEST(testRepeatedColumnsODS); CPPUNIT_TEST(testRepeatedColumnsODS);
CPPUNIT_TEST(testDataValidityODS); CPPUNIT_TEST(testDataValidityODS);
CPPUNIT_TEST(testDataTableXLS);
CPPUNIT_TEST(testBrokenQuotesCSV); CPPUNIT_TEST(testBrokenQuotesCSV);
CPPUNIT_TEST(testCellValueXLSX); CPPUNIT_TEST(testCellValueXLSX);
CPPUNIT_TEST(testControlImport); CPPUNIT_TEST(testControlImport);
...@@ -1171,6 +1173,57 @@ void ScFiltersTest::testDataValidityODS() ...@@ -1171,6 +1173,57 @@ void ScFiltersTest::testDataValidityODS()
xDocSh->DoClose(); xDocSh->DoClose();
} }
void ScFiltersTest::testDataTableXLS()
{
ScDocShellRef xDocSh = loadDoc("data-table.", XLS);
ScFormulaOptions aOptions;
aOptions.SetFormulaSepArg(",");
aOptions.SetFormulaSepArrayCol(",");
aOptions.SetFormulaSepArrayRow(";");
xDocSh->SetFormulaOptions(aOptions);
ScDocument* pDoc = xDocSh->GetDocument();
// One-variable table
if (!checkFormula(*pDoc, ScAddress(3,1,0), "PMT(B3/12,B4,-B5)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,2,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C3)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,3,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C4)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,4,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C5)"))
CPPUNIT_FAIL("Wrong formula!");
// Two-variable table
if (!checkFormula(*pDoc, ScAddress(2,7,0), "PMT(B9/12,B10,-B11)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(3,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(4,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(4,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*pDoc, ScAddress(4,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
xDocSh->DoClose();
}
void ScFiltersTest::testBrokenQuotesCSV() void ScFiltersTest::testBrokenQuotesCSV()
{ {
const OUString aFileNameBase("fdo48621_broken_quotes."); const OUString aFileNameBase("fdo48621_broken_quotes.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment