diff options
author | Daniel Bankston <daniel.e.bankston@gmail.com> | 2012-07-08 12:45:52 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-07-11 20:37:41 -0400 |
commit | 2fbe6e30c4481a4885b3e487bcd5466456a7b1d5 (patch) | |
tree | 994e98a83219f7d7d1aa6800a9b3e362f0a784c2 | |
parent | 20f8ade0aed4ce2f923370e148cd2d2b251fc863 (diff) |
Add test for cached matrix formula results
-Includes test case for cached formula result errors
Change-Id: I446240daffdbd6cd7ebd3c3b8dc2305c789d8519
-rw-r--r-- | sc/qa/unit/data/contentCSV/matrix2.csv | 2 | ||||
-rw-r--r-- | sc/qa/unit/data/ods/matrix.ods | bin | 13159 -> 12974 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 23 |
3 files changed, 24 insertions, 1 deletions
diff --git a/sc/qa/unit/data/contentCSV/matrix2.csv b/sc/qa/unit/data/contentCSV/matrix2.csv new file mode 100644 index 000000000000..44b3f716334e --- /dev/null +++ b/sc/qa/unit/data/contentCSV/matrix2.csv @@ -0,0 +1,2 @@ +Matrix with errors:,, +Err:502,Err:502,Err:502 diff --git a/sc/qa/unit/data/ods/matrix.ods b/sc/qa/unit/data/ods/matrix.ods Binary files differindex 3c9f16a4b400..7b69691726c5 100644 --- a/sc/qa/unit/data/ods/matrix.ods +++ b/sc/qa/unit/data/ods/matrix.ods diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index ad89fd83ce29..01197ffe75b5 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 testCachedMatrixFormulaResultsODS(); void testDatabaseRangesODS(); void testDatabaseRangesXLS(); void testDatabaseRangesXLSX(); @@ -144,6 +145,7 @@ public: CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testFunctionsODS); CPPUNIT_TEST(testCachedFormulaResultsODS); + CPPUNIT_TEST(testCachedMatrixFormulaResultsODS); CPPUNIT_TEST(testDatabaseRangesODS); CPPUNIT_TEST(testDatabaseRangesXLS); CPPUNIT_TEST(testDatabaseRangesXLSX); @@ -323,7 +325,7 @@ void ScFiltersTest::testHardRecalcODS() ScDocShellRef xDocSh = loadDoc( aFileNameBase, ODS ); xDocSh->DoHardRecalc(true); - CPPUNIT_ASSERT_MESSAGE("Failed to load functions.*", xDocSh.Is()); + CPPUNIT_ASSERT_MESSAGE("Failed to load hard-recalc.*", xDocSh.Is()); ScDocument* pDoc = xDocSh->GetDocument(); rtl::OUString aCSVFileName; @@ -386,6 +388,25 @@ void ScFiltersTest::testCachedFormulaResultsODS() xDocSh->DoClose(); } +void ScFiltersTest::testCachedMatrixFormulaResultsODS() +{ + const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("matrix.")); + ScDocShellRef xDocSh = loadDoc( aFileNameBase, ODS); + + CPPUNIT_ASSERT_MESSAGE("Failed to load matrix.*", xDocSh.Is()); + ScDocument* pDoc = xDocSh->GetDocument(); + + //test matrix + rtl::OUString aCSVFileName; + createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix.")), aCSVFileName); + testFile(aCSVFileName, pDoc, 0); + //test matrix with errors + createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix2.")), aCSVFileName); + testFile(aCSVFileName, pDoc, 1); + + xDocSh->DoClose(); +} + namespace { void testDBRanges_Impl(ScDocument* pDoc, sal_Int32 nFormat) |