Refactor wxAuiNotebook unit test to use a test fixture
No real changes, this will just make adding more tests using wxAuiNotebook simpler.
This commit is contained in:
@@ -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<wxAuiNotebook> 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") );
|
||||
|
Reference in New Issue
Block a user