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

Add new filter test for raw cell value import from ods.

If import of raw cell values doesn't work, all bets are off. Let's make
sure it does.

We'll add more test cases to this file as the need arises.

Change-Id: I1469c285e6e87056406415bd8c767890c153b2b5
üst ca4cbae3
...@@ -95,6 +95,7 @@ public: ...@@ -95,6 +95,7 @@ public:
virtual void tearDown(); virtual void tearDown();
//ods, xls, xlsx filter tests //ods, xls, xlsx filter tests
void testBasicCellContentODS();
void testRangeNameXLS(); void testRangeNameXLS();
void testRangeNameXLSX(); void testRangeNameXLSX();
void testHardRecalcODS(); void testHardRecalcODS();
...@@ -151,6 +152,7 @@ public: ...@@ -151,6 +152,7 @@ public:
void testOptimalHeightReset(); void testOptimalHeightReset();
CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBasicCellContentODS);
CPPUNIT_TEST(testRangeNameXLS); CPPUNIT_TEST(testRangeNameXLS);
CPPUNIT_TEST(testRangeNameXLSX); CPPUNIT_TEST(testRangeNameXLSX);
CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testHardRecalcODS);
...@@ -266,6 +268,22 @@ void testRangeNameImpl(ScDocument* pDoc) ...@@ -266,6 +268,22 @@ void testRangeNameImpl(ScDocument* pDoc)
} }
void ScFiltersTest::testBasicCellContentODS()
{
ScDocShellRef xDocSh = loadDoc("basic-cell-content.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load basic-cell-content.ods", xDocSh.Is());
ScDocument* pDoc = xDocSh->GetDocument();
OUString aStr = pDoc->GetString(1, 1, 0); // B2
CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice Calc"), aStr);
double fVal = pDoc->GetValue(1, 2, 0); // B3
CPPUNIT_ASSERT_EQUAL(12345.0, fVal);
aStr = pDoc->GetString(1, 3, 0); // B4
CPPUNIT_ASSERT_EQUAL(OUString("A < B"), aStr);
xDocSh->DoClose();
}
void ScFiltersTest::testRangeNameXLS() void ScFiltersTest::testRangeNameXLS()
{ {
ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS); ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS);
......
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