diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-02 11:19:05 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-02 20:56:30 -0400 |
commit | bdad8d9051c207b2eff0d5a7842da83e6119a600 (patch) | |
tree | a49cf57de7ead9266470df0010a4aec9d51dc109 /chart2/qa | |
parent | 397362d8532d7b0abe38f2024dd2cefe2482d6a3 (diff) |
More fine-grained check of data series labels in the unit test.
Change-Id: I6b23126816bb114407f2b75545094bc297ee7cc3
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 16a0f03a6b0e..b7c1e78f663b 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -280,10 +280,17 @@ void Chart2ImportTest::testDOCChartSeries() void Chart2ImportTest::testDOCXChartSeries() { load("/chart2/qa/extras/data/docx/", "chart.docx"); - uno::Sequence< OUString > seriesList = getWriterChartColumnDescriptions(mxComponent); - CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), seriesList[0]); - CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), seriesList[1]); - CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), seriesList[2]); + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference<chart2::XChartType> xCT = getChartTypeFromDoc(xChartDoc, 0, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), aLabels[0][0].get<OUString>()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), aLabels[1][0].get<OUString>()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get<OUString>()); } void Chart2ImportTest::testPPTChartSeries() @@ -300,11 +307,18 @@ void Chart2ImportTest::testPPTChartSeries() void Chart2ImportTest::testPPTXChartSeries() { //test chart series names for pptx - uno::Sequence < OUString > seriesList = getImpressChartColumnDescriptions("/chart2/qa/extras/data/pptx/", "chart.pptx"); - CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[1]); - CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[2]); - CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[3]); + load("/chart2/qa/extras/data/pptx/", "chart.pptx"); + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference<chart2::XChartType> xCT = getChartTypeFromDoc(xChartDoc, 0, 0); + CPPUNIT_ASSERT(xCT.is()); + std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), aLabels[0][0].get<OUString>()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), aLabels[1][0].get<OUString>()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get<OUString>()); } void Chart2ImportTest::testODPChartSeries() |