]> git.saurik.com Git - wxWidgets.git/blame_incremental - tests/controls/frametest.cpp
Fix Doxygen warnings due to documenting overloaded functions together.
[wxWidgets.git] / tests / controls / frametest.cpp
... / ...
CommitLineData
1///////////////////////////////////////////////////////////////////////////////
2// Name: tests/controls/frametest.cpp
3// Purpose: wxFrame unit test
4// Author: Steven Lamerton
5// Created: 2010-07-10
6// Copyright: (c) 2010 Steven Lamerton
7///////////////////////////////////////////////////////////////////////////////
8
9#include "testprec.h"
10
11#ifdef __BORLANDC__
12 #pragma hdrstop
13#endif
14
15#ifndef WX_PRECOMP
16 #include "wx/app.h"
17 #include "wx/frame.h"
18#endif // WX_PRECOMP
19
20#include "testableframe.h"
21
22class FrameTestCase : public CppUnit::TestCase
23{
24public:
25 FrameTestCase() { }
26
27 void setUp();
28 void tearDown();
29
30private:
31 CPPUNIT_TEST_SUITE( FrameTestCase );
32 CPPUNIT_TEST( Iconize );
33 CPPUNIT_TEST( Close );
34 CPPUNIT_TEST_SUITE_END();
35
36 void Iconize();
37 void Close();
38
39 wxFrame *m_frame;
40
41 DECLARE_NO_COPY_CLASS(FrameTestCase)
42};
43
44// register in the unnamed registry so that these tests are run by default
45CPPUNIT_TEST_SUITE_REGISTRATION( FrameTestCase );
46
47// also include in its own registry so that these tests can be run alone
48CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( FrameTestCase, "FrameTestCase" );
49
50void FrameTestCase::setUp()
51{
52 m_frame = new wxFrame(NULL, wxID_ANY, "test frame");
53 m_frame->Show();
54}
55
56void FrameTestCase::tearDown()
57{
58 m_frame->Destroy();
59}
60
61void FrameTestCase::Iconize()
62{
63#ifdef __WXMSW__
64 EventCounter iconize(m_frame, wxEVT_ICONIZE);
65
66 m_frame->Iconize();
67 m_frame->Iconize(false);
68
69 CPPUNIT_ASSERT_EQUAL(2, iconize.GetCount());
70#endif
71}
72
73void FrameTestCase::Close()
74{
75 EventCounter close(m_frame, wxEVT_CLOSE_WINDOW);
76
77 m_frame->Close();
78
79 CPPUNIT_ASSERT_EQUAL(1, close.GetCount());
80}