From 9e15d9e76d1fd542378a997e27175ca98dd3e558 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 11 Feb 2013 17:51:22 -0500 Subject: 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 --- sc/qa/unit/data/ods/basic-cell-content.ods | Bin 0 -> 10041 bytes sc/qa/unit/subsequent_filters-test.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 sc/qa/unit/data/ods/basic-cell-content.ods 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 Binary files /dev/null and b/sc/qa/unit/data/ods/basic-cell-content.ods 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); -- cgit