summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2016-09-27 22:11:18 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2016-09-27 22:13:17 -0400
commit3d9231dd4945dcd6c3d53ba11152049d382b975f (patch)
treed78fb3f4ea5ff6d64e41ced121b70426711b1472 /sc
parent57d925dede88d870a20f6ec469a26bf6961658ce (diff)
Add a bit more checking on the internal pivot table states.
Change-Id: I8be8f510cecab8ec8aa07f2f81795bbfdf727a26
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7f8b614d89c8..8ef4a8c7e7be 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -2070,7 +2070,6 @@ void ScFiltersTest::testPivotTableSharedGroupXLSX()
ScDocShellRef xDocSh = loadDoc("pivot-table/shared-group-field.", FORMAT_XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
ScDocument& rDoc = xDocSh->GetDocument();
- rDoc.CalcAll();
// Check whether right group names are imported for both tables
// First table
@@ -2089,6 +2088,20 @@ void ScFiltersTest::testPivotTableSharedGroupXLSX()
CPPUNIT_ASSERT_EQUAL(OUString("17"), rDoc.GetString(ScAddress(0,16,0)));
CPPUNIT_ASSERT_EQUAL(OUString("18"), rDoc.GetString(ScAddress(0,17,0)));
+ // There should be exactly 2 pivot tables and 1 cache.
+ ScDPCollection* pDPs = rDoc.GetDPCollection();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pDPs->GetCount());
+
+ ScDPCollection::SheetCaches& rSheetCaches = pDPs->GetSheetCaches();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rSheetCaches.size());
+
+ const ScDPCache* pCache = rSheetCaches.getExistingCache(ScRange(0,0,1,13,18,1));
+ CPPUNIT_ASSERT_MESSAGE("Pivot cache is expected for A1:N19 on the second sheet.", pCache);
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), pCache->GetFieldCount());
+
+ // TODO : Look into this and find out why it fails.
+ // CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pCache->GetGroupFieldCount());
+
xDocSh->DoClose();
}