summaryrefslogtreecommitdiff
path: root/chart2/qa/extras/chart2export.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-10 19:46:37 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-10 19:48:16 -0400
commit81d2c208a4e6f9df87e2ee70c6e6da146742178a (patch)
treea2e6b205753e67a8056ab9ae9a19177c44512869 /chart2/qa/extras/chart2export.cxx
parentad2cc2323fb887c438031d863ab16df7afd49fb8 (diff)
New unit test for Draw document with chart. Disabled due to weird crash.
No idea why it crashes whatsoever.... Change-Id: Ic46d5a98f21cacb03adb3bc0d6da239bde5d8ce2
Diffstat (limited to 'chart2/qa/extras/chart2export.cxx')
-rw-r--r--chart2/qa/extras/chart2export.cxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 4443b06f4680..297950b837e2 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -50,6 +50,7 @@ public:
void testShapeFollowedByChart();
void testPieChartDataLabels();
void testSeriesIdxOrder();
+ void testScatterPlotLabels();
void testErrorBarDataRangeODS();
void testChartCrash();
void testPieChartRotation();
@@ -82,6 +83,7 @@ public:
CPPUNIT_TEST(testShapeFollowedByChart);
CPPUNIT_TEST(testPieChartDataLabels);
CPPUNIT_TEST(testSeriesIdxOrder);
+// CPPUNIT_TEST(testScatterPlotLabels); TODO : This test crashes for some unknown reason.
CPPUNIT_TEST(testErrorBarDataRangeODS);
CPPUNIT_TEST(testChartCrash);
CPPUNIT_TEST(testPieChartRotation);
@@ -712,6 +714,50 @@ void Chart2ExportTest::testSeriesIdxOrder()
assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]", "val", "1");
}
+void Chart2ExportTest::testScatterPlotLabels()
+{
+ load("/chart2/qa/extras/data/odg/", "scatter-plot-labels.odg");
+ 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());
+
+ OUString aLabelRole = xCT->getRoleOfSequenceForSeriesLabel();
+
+ fprintf(stdout, "Chart2ExportTest::testScatterPlotLabels: label role = '%s\n",
+ rtl::OUStringToOString(aLabelRole, RTL_TEXTENCODING_UTF8).getStr());
+
+ Reference<chart2::XDataSeriesContainer> xDSCont(xCT, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDSCont.is());
+ Sequence<uno::Reference<chart2::XDataSeries> > aDataSeriesSeq = xDSCont->getDataSeries();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aDataSeriesSeq.getLength());
+
+ for (sal_Int32 i = 0; i < aDataSeriesSeq.getLength(); ++i)
+ {
+ uno::Reference<chart2::data::XDataSource> xDSrc(aDataSeriesSeq[i], uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDSrc.is());
+ uno::Sequence<Reference<chart2::data::XLabeledDataSequence> > aDataSeqs = xDSrc->getDataSequences();
+ for (sal_Int32 j = 0; j < aDataSeqs.getLength(); ++j)
+ {
+ Reference<chart2::data::XDataSequence> xValues = aDataSeqs[j]->getValues();
+ CPPUNIT_ASSERT(xValues.is());
+ Reference<beans::XPropertySet> xPropSet(xValues, uno::UNO_QUERY);
+ if (!xPropSet.is())
+ continue;
+
+ OUString aRoleName;
+ xPropSet->getPropertyValue("Role") >>= aRoleName;
+ if (aRoleName == aLabelRole)
+ {
+ // TODO : Check the data series labels.
+ }
+ }
+ }
+
+ CPPUNIT_ASSERT(false);
+}
+
void Chart2ExportTest::testErrorBarDataRangeODS()
{
load("/chart2/qa/extras/data/ods/", "ErrorBarRange.ods");