diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-22 14:20:51 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-22 14:21:12 +0200 |
commit | 426ed149c998d3482ce339f7655c42b2928abc84 (patch) | |
tree | e7c56b2161e56f5c08c6bd370b4b910ee67549d1 | |
parent | 2ffc416d2e5a2b4145008c372913604fa1990e29 (diff) |
add test case for error bar range import
Change-Id: I6719731d1b142bc49cdd5b93e8bc22520d5db540
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 34 | ||||
-rw-r--r-- | chart2/qa/extras/data/ods/error_bar_range.ods | bin | 0 -> 13490 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/ods/fdo60083.ods (renamed from chart2/qa/extras/data/ods/error_bar_simple.ods) | bin | 14538 -> 14538 bytes |
3 files changed, 33 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 251c8a188833..b498c695ff96 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -41,6 +41,7 @@ class Chart2ImportTest : public test::BootstrapFixture, public unotest::MacrosTe public: void Fdo60083(); void testSteppedLines(); + void testErrorBarRange(); virtual void setUp(); virtual void tearDown(); @@ -48,6 +49,7 @@ public: CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); CPPUNIT_TEST(testSteppedLines); + CPPUNIT_TEST(testErrorBarRange); CPPUNIT_TEST_SUITE_END(); private: @@ -66,7 +68,7 @@ private: // split method up into smaller chunks for more detailed tests void Chart2ImportTest::Fdo60083() { - load("/chart2/qa/extras/data/ods/", "error_bar_simple.ods"); + load("/chart2/qa/extras/data/ods/", "fdo60083.ods"); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -114,6 +116,36 @@ void Chart2ImportTest::Fdo60083() CPPUNIT_ASSERT(!xErrorBarXProps.is()); } +void Chart2ImportTest::testErrorBarRange() +{ + load("/chart2/qa/extras/data/ods/", "error_bar_range.ods"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + CPPUNIT_ASSERT( xPropSet.is() ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps; + CPPUNIT_ASSERT(xErrorBarYProps.is()); + + sal_Int32 nErrorBarStyle; + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("ErrorBarStyle") + >>= nErrorBarStyle); + CPPUNIT_ASSERT_EQUAL( + static_cast<sal_Int32>(chart::ErrorBarStyle::FROM_DATA), + nErrorBarStyle); + + OUString aRangePos; + CPPUNIT_ASSERT(xErrorBarYProps->getPropertyValue("ErrorBarRangePositive") >>= aRangePos); + CPPUNIT_ASSERT_EQUAL(aRangePos, OUString("$Sheet1.$C$2:$C$4")); +} + // stepped line interpolation void Chart2ImportTest::testSteppedLines() diff --git a/chart2/qa/extras/data/ods/error_bar_range.ods b/chart2/qa/extras/data/ods/error_bar_range.ods Binary files differnew file mode 100644 index 000000000000..27a0103e5789 --- /dev/null +++ b/chart2/qa/extras/data/ods/error_bar_range.ods diff --git a/chart2/qa/extras/data/ods/error_bar_simple.ods b/chart2/qa/extras/data/ods/fdo60083.ods Binary files differindex 74704f6185ac..74704f6185ac 100644 --- a/chart2/qa/extras/data/ods/error_bar_simple.ods +++ b/chart2/qa/extras/data/ods/fdo60083.ods |