Ensure that test notebook is destroyed after the end of its test

Don't let wxNotebook created in the recently added test for the events
generated when adding pages to it continue to live after the test end as
this breaks the subsequent tests using wxUIActionSimulator (but only
when using MinGW, for some reason).
This commit is contained in:
Vadim Zeitlin
2019-02-02 17:40:33 +01:00
parent 0a7b5a9879
commit 9886c25645

View File

@@ -20,6 +20,7 @@
#endif // WX_PRECOMP #endif // WX_PRECOMP
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/scopedptr.h"
#include "bookctrlbasetest.h" #include "bookctrlbasetest.h"
#include "testableframe.h" #include "testableframe.h"
@@ -125,6 +126,7 @@ TEST_CASE("wxNotebook::AddPageEvents", "[wxNotebook][AddPage][event]")
wxNotebook* const wxNotebook* const
notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY, notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY,
wxDefaultPosition, wxSize(400, 200)); wxDefaultPosition, wxSize(400, 200));
wxScopedPtr<wxNotebook> cleanup(notebook);
CHECK( notebook->GetSelection() == wxNOT_FOUND ); CHECK( notebook->GetSelection() == wxNOT_FOUND );