summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-02-11 17:51:22 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-02-11 22:33:36 -0500
commit9e15d9e76d1fd542378a997e27175ca98dd3e558 (patch)
tree95b3c57d672ba25ad08e7ad8f664811c4e5d7a7d /sc/qa
parentca4cbae35630cc314d33cc7ad9bea36063097fa5 (diff)
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
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/ods/basic-cell-content.odsbin0 -> 10041 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/basic-cell-content.ods b/sc/qa/unit/data/ods/basic-cell-content.ods
new file mode 100644
index 000000000000..70f6b6e82746
--- /dev/null
+++ b/sc/qa/unit/data/ods/basic-cell-content.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 16db9547eb10..748922f6940c 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -95,6 +95,7 @@ public:
virtual void tearDown();
//ods, xls, xlsx filter tests
+ void testBasicCellContentODS();
void testRangeNameXLS();
void testRangeNameXLSX();
void testHardRecalcODS();
@@ -151,6 +152,7 @@ public:
void testOptimalHeightReset();
CPPUNIT_TEST_SUITE(ScFiltersTest);
+ CPPUNIT_TEST(testBasicCellContentODS);
CPPUNIT_TEST(testRangeNameXLS);
CPPUNIT_TEST(testRangeNameXLSX);
CPPUNIT_TEST(testHardRecalcODS);
@@ -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()
{
ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS);