Kaydet (Commit) 7553deec authored tarafından Michael Meeks's avatar Michael Meeks

vcl: new lifecycle test.

Change-Id: I05500c136839877db5c4a215b15e24a8444d3c16
üst eb7f057e
......@@ -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();
......
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