From 740dac4d58a95709eb11fc7434a7904ff8fafbd8 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 6 May 2014 18:36:55 -0400 Subject: fdo#77990: Write test for this, using the 2nd test document submitted. Change-Id: I70d71bb21ff43aeb49339ff1f1d9e73c923e0201 --- sc/qa/unit/data/ods/hybrid-shared-string.ods | Bin 0 -> 12479 bytes sc/qa/unit/subsequent_filters-test.cxx | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 sc/qa/unit/data/ods/hybrid-shared-string.ods (limited to 'sc') diff --git a/sc/qa/unit/data/ods/hybrid-shared-string.ods b/sc/qa/unit/data/ods/hybrid-shared-string.ods new file mode 100644 index 000000000000..89f59d6424de Binary files /dev/null and b/sc/qa/unit/data/ods/hybrid-shared-string.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 8870b9bbece4..7983e4cec8e6 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -172,6 +172,7 @@ public: void testSharedFormulaWrappedRefsXLS(); void testExternalRefCacheXLSX(); void testExternalRefCacheODS(); + void testHybridSharedStringODS(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testBasicCellContentODS); @@ -248,6 +249,7 @@ public: CPPUNIT_TEST(testSharedFormulaWrappedRefsXLS); CPPUNIT_TEST(testExternalRefCacheXLSX); CPPUNIT_TEST(testExternalRefCacheODS); + CPPUNIT_TEST(testHybridSharedStringODS); CPPUNIT_TEST_SUITE_END(); private: @@ -2541,6 +2543,19 @@ void ScFiltersTest::testExternalRefCacheODS() xDocSh->DoClose(); } +void ScFiltersTest::testHybridSharedStringODS() +{ + ScDocShellRef xDocSh = loadDoc("hybrid-shared-string.", ODS); + + CPPUNIT_ASSERT(xDocSh.Is()); + ScDocument* pDoc = xDocSh->GetDocument(); + + // A2 contains formula with MATCH function. The result must be 2, not #N/A! + CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(0,1,0))); + + xDocSh->DoClose(); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { -- cgit