summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-07-11 01:54:46 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-11 20:37:43 -0400
commitc3452373b90bc952f32db8a08413c87958b0f2df (patch)
tree3932beca44a9a72bd4c41677048ea91e84a19fa2 /sc
parent6bf50c8d50a599d820289831ec4175136882b0d4 (diff)
Add test for volatile functions for ODS import
Change-Id: If2f85e32ddeb9f25b4a355ce5451dc04925bbbc9
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/ods/volatile.odsbin0 -> 7982 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx24
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
new file mode 100644
index 000000000000..6278de7c9c1e
--- /dev/null
+++ b/sc/qa/unit/data/ods/volatile.ods
Binary files 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."));