diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/volatile.ods | bin | 0 -> 7982 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/volatile.ods b/sc/qa/unit/data/ods/volatile.ods Binary files differnew file mode 100644 index 000000000000..6278de7c9c1e --- /dev/null +++ b/sc/qa/unit/data/ods/volatile.ods 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.")); |