diff --git a/tests/controls/auitest.cpp b/tests/controls/auitest.cpp index 0bf9b4d2a8..2521710ba8 100644 --- a/tests/controls/auitest.cpp +++ b/tests/controls/auitest.cpp @@ -20,23 +20,38 @@ #endif // WX_PRECOMP #include "wx/panel.h" -#include "wx/scopedptr.h" #include "wx/aui/auibook.h" #include "asserthelper.h" // ---------------------------------------------------------------------------- -// test class +// test fixtures // ---------------------------------------------------------------------------- -TEST_CASE( "wxAuiNotebook::DoGetBestSize", "[aui]" ) +class AuiNotebookTestCase { - wxWindow *frame = wxTheApp->GetTopWindow(); - REQUIRE( frame ); - wxAuiNotebook *nb = new wxAuiNotebook(frame); - wxScopedPtr cleanUp(nb); +public: + AuiNotebookTestCase() + : nb(new wxAuiNotebook(wxTheApp->GetTopWindow())) + { + } + ~AuiNotebookTestCase() + { + delete nb; + } + +protected: + wxAuiNotebook* const nb; +}; + +// ---------------------------------------------------------------------------- +// the tests themselves +// ---------------------------------------------------------------------------- + +TEST_CASE_METHOD(AuiNotebookTestCase, "wxAuiNotebook::DoGetBestSize", "[aui]") +{ wxPanel *p = new wxPanel(nb); p->SetMinSize(wxSize(100, 100)); REQUIRE( nb->AddPage(p, "Center Pane") );