From c3452373b90bc952f32db8a08413c87958b0f2df Mon Sep 17 00:00:00 2001 From: Daniel Bankston Date: Wed, 11 Jul 2012 01:54:46 -0500 Subject: Add test for volatile functions for ODS import Change-Id: If2f85e32ddeb9f25b4a355ce5451dc04925bbbc9 --- sc/qa/unit/data/ods/volatile.ods | Bin 0 -> 7982 bytes sc/qa/unit/subsequent_filters-test.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sc/qa/unit/data/ods/volatile.ods (limited to 'sc/qa') diff --git a/sc/qa/unit/data/ods/volatile.ods b/sc/qa/unit/data/ods/volatile.ods new file mode 100644 index 000000000000..6278de7c9c1e Binary files /dev/null and b/sc/qa/unit/data/ods/volatile.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 01197ffe75b5..b57757d10c12 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -109,6 +109,7 @@ public: void testHardRecalcODS(); void testFunctionsODS(); void testCachedFormulaResultsODS(); + void testVolatileFunctionsODS(); void testCachedMatrixFormulaResultsODS(); void testDatabaseRangesODS(); void testDatabaseRangesXLS(); @@ -145,6 +146,7 @@ public: CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testFunctionsODS); CPPUNIT_TEST(testCachedFormulaResultsODS); + CPPUNIT_TEST(testVolatileFunctionsODS); CPPUNIT_TEST(testCachedMatrixFormulaResultsODS); CPPUNIT_TEST(testDatabaseRangesODS); CPPUNIT_TEST(testDatabaseRangesXLS); @@ -388,6 +390,28 @@ void ScFiltersTest::testCachedFormulaResultsODS() xDocSh->DoClose(); } +void ScFiltersTest::testVolatileFunctionsODS() +{ + const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("volatile.")); + ScDocShellRef xDocSh = loadDoc( aFileNameBase, ODS ); + + CPPUNIT_ASSERT_MESSAGE("Failed to load volatile.ods", xDocSh.Is()); + ScDocument* pDoc = xDocSh->GetDocument(); + + //we want to me sure that volatile functions are always recalculated + //regardless of cached results. if you update the ods file, you must + //update the values here. + //if NOW() is recacluated, then it should never equal sTodayCache + OUString sTodayCache("07/11/12 12:28 AM"); + OUString sTodayRecalc(pDoc->GetString(0,1,0)); + CPPUNIT_ASSERT(sTodayCache != sTodayRecalc); + + OUString sTodayRecalcRef(pDoc->GetString(2,1,0)); + CPPUNIT_ASSERT(sTodayCache != sTodayRecalcRef); + + xDocSh->DoClose(); +} + void ScFiltersTest::testCachedMatrixFormulaResultsODS() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("matrix.")); -- cgit v1.2.3