diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-02-26 16:09:06 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:22:50 +0100 |
commit | 7553deec1aee40abd663c3c4d63d9629f69d6c2f (patch) | |
tree | 0dcb6ea499cac9e46ef814d066f05fecf05dda3f /vcl/qa | |
parent | eb7f057e4b71aae711e786296d4fe95b840e7a8f (diff) |
vcl: new lifecycle test.
Change-Id: I05500c136839877db5c4a215b15e24a8444d3c16
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/lifecycle.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx index dc6bbf273940..2a46022eb569 100644 --- a/vcl/qa/cppunit/lifecycle.cxx +++ b/vcl/qa/cppunit/lifecycle.cxx @@ -27,12 +27,14 @@ public: void testMultiDispose(); void testIsolatedWidgets(); void testParentedWidgets(); + void testChildDispose(); CPPUNIT_TEST_SUITE(LifecycleTest); CPPUNIT_TEST(testCast); CPPUNIT_TEST(testMultiDispose); CPPUNIT_TEST(testIsolatedWidgets); CPPUNIT_TEST(testParentedWidgets); + CPPUNIT_TEST(testChildDispose); CPPUNIT_TEST_SUITE_END(); }; @@ -94,6 +96,27 @@ void LifecycleTest::testParentedWidgets() testWidgets(xWin); } +class DisposableChild : public vcl::Window +{ +public: + DisposableChild(vcl::Window *pParent) : vcl::Window(pParent) {} + virtual ~DisposableChild() + { + dispose(); + } +}; + +void LifecycleTest::testChildDispose() +{ + VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL, + WB_APP|WB_STDWORK)); + CPPUNIT_ASSERT(xWin.get() != NULL); + VclPtr<DisposableChild> xChild(new DisposableChild(xWin.get())); + xWin->Show(); + xChild->dispose(); + xWin->dispose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(LifecycleTest); CPPUNIT_PLUGIN_IMPLEMENT(); |