[Libreoffice-commits] core.git: sc/qa
Tamás Zolnai
tamas.zolnai at collabora.com
Tue Sep 27 21:38:01 UTC 2016
sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx |binary
sc/qa/unit/subsequent_filters-test.cxx | 29 +++++++++++++++++++++
2 files changed, 29 insertions(+)
New commits:
commit 049d2ffd329f88934a92b72e4ec650ea46bf8c61
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Wed Sep 28 07:38:22 2016 +0200
Test the case for pivot tables sharing a group
Fixed with 3b64a198568d5b2bb14066581aca112cc6182fd7
Change-Id: Ideea06ea95f6c565e1487f2b27ef249c38c5d4dd
diff --git a/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx b/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx
new file mode 100644
index 0000000..2bc5cdd
Binary files /dev/null and b/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 4b53e2d..3195fa8 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -200,6 +200,7 @@ public:
void testPivotTableNamedRangeSourceODS();
void testPivotTableSharedCacheGroupODS();
void testGetPivotDataXLS();
+ void testPivotTableSharedGroupXLSX();
void testFormulaDependency();
@@ -305,6 +306,7 @@ public:
CPPUNIT_TEST(testPivotTableNamedRangeSourceODS);
CPPUNIT_TEST(testPivotTableSharedCacheGroupODS);
CPPUNIT_TEST(testGetPivotDataXLS);
+ CPPUNIT_TEST(testPivotTableSharedGroupXLSX);
CPPUNIT_TEST(testRowHeightODS);
CPPUNIT_TEST(testFormulaDependency);
CPPUNIT_TEST(testRichTextContentODS);
@@ -2063,6 +2065,33 @@ void ScFiltersTest::testGetPivotDataXLS()
xDocSh->DoClose();
}
+void ScFiltersTest::testPivotTableSharedGroupXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("pivot-table/shared_group.", 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
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), rDoc.GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), rDoc.GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), rDoc.GetString(ScAddress(0,4,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("16"), rDoc.GetString(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("17"), rDoc.GetString(ScAddress(0,6,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("18"), rDoc.GetString(ScAddress(0,7,0)));
+
+ // Second table
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), rDoc.GetString(ScAddress(0,12,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), rDoc.GetString(ScAddress(0,13,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), rDoc.GetString(ScAddress(0,14,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("16"), rDoc.GetString(ScAddress(0,15,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("17"), rDoc.GetString(ScAddress(0,16,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("18"), rDoc.GetString(ScAddress(0,17,0)));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testRowHeightODS()
{
ScDocShellRef xDocSh = loadDoc("row-height-import.", FORMAT_ODS);
More information about the Libreoffice-commits
mailing list