Kaydet (Commit) 3c8bee80 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#68839: add unit test

Change-Id: Ic47bfdeb1466a3772c95008dbf035f294cc3ece4
üst ba083e5c
...@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\ ...@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\
basic/util/sb \ basic/util/sb \
comphelper/util/comphelp \ comphelper/util/comphelp \
configmgr/source/configmgr \ configmgr/source/configmgr \
embeddedobj/util/embobj \
fileaccess/source/fileacc \ fileaccess/source/fileacc \
filter/source/config/cache/filterconfig1 \ filter/source/config/cache/filterconfig1 \
framework/util/fwk \ framework/util/fwk \
......
...@@ -27,6 +27,7 @@ public: ...@@ -27,6 +27,7 @@ public:
void testFdo60842(); void testFdo60842();
void testFdo56272(); void testFdo56272();
void testFdo55814(); void testFdo55814();
void testFdo68839();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -50,6 +51,7 @@ void Test::run() ...@@ -50,6 +51,7 @@ void Test::run()
{"fdo60842.odt", &Test::testFdo60842}, {"fdo60842.odt", &Test::testFdo60842},
{"fdo56272.odt", &Test::testFdo56272}, {"fdo56272.odt", &Test::testFdo56272},
{"fdo55814.odt", &Test::testFdo55814}, {"fdo55814.odt", &Test::testFdo55814},
{"fdo68839.odt", &Test::testFdo68839},
}; };
header(); header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
...@@ -320,6 +322,39 @@ void Test::testFdo55814() ...@@ -320,6 +322,39 @@ void Test::testFdo55814()
CPPUNIT_ASSERT_EQUAL(OUString("Hide==\"Yes\""), getProperty<OUString>(xSections->getByIndex(0), "Condition")); CPPUNIT_ASSERT_EQUAL(OUString("Hide==\"Yes\""), getProperty<OUString>(xSections->getByIndex(0), "Condition"));
} }
void lcl_CheckShape(
uno::Reference<drawing::XShape> const& xShape, OUString const& rExpected)
{
uno::Reference<container::XNamed> const xNamed(xShape, uno::UNO_QUERY);
CPPUNIT_ASSERT(xNamed.is());
CPPUNIT_ASSERT_EQUAL(rExpected, xNamed->getName());
}
void Test::testFdo68839()
{
// check names
lcl_CheckShape(getShape(1), "FrameXXX");
lcl_CheckShape(getShape(2), "ObjectXXX");
lcl_CheckShape(getShape(3), "FrameY");
lcl_CheckShape(getShape(4), "graphicsXXX");
try {
uno::Reference<drawing::XShape> xShape = getShape(5);
CPPUNIT_ASSERT(!"IndexOutOfBoundsException expected");
} catch (lang::IndexOutOfBoundsException const&) { }
// check prev/next chain
uno::Reference<beans::XPropertySet> xFrame1(getShape(1), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xFrame2(getShape(3), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString(),
getProperty<OUString>(xFrame1, "ChainPrevName"));
CPPUNIT_ASSERT_EQUAL(OUString("FrameY"),
getProperty<OUString>(xFrame1, "ChainNextName"));
CPPUNIT_ASSERT_EQUAL(OUString("FrameXXX"),
getProperty<OUString>(xFrame2, "ChainPrevName"));
CPPUNIT_ASSERT_EQUAL(OUString(),
getProperty<OUString>(xFrame2, "ChainNextName"));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment