diff --git a/tests/sizers/boxsizer.cpp b/tests/sizers/boxsizer.cpp index 575fdcd3b3..3bf4d6aba9 100644 --- a/tests/sizers/boxsizer.cpp +++ b/tests/sizers/boxsizer.cpp @@ -24,6 +24,8 @@ #include "asserthelper.h" +#include "wx/scopedptr.h" + // ---------------------------------------------------------------------------- // test fixture // ---------------------------------------------------------------------------- @@ -367,7 +369,9 @@ TEST_CASE_METHOD(BoxSizerTestCase, "BoxSizer::IncompatibleFlags", "[sizer]") #define ASSERT_SIZER_INVALID_FLAGS(f, msg) \ WX_ASSERT_FAILS_WITH_ASSERT_MESSAGE( \ "Expected assertion not generated for " msg, \ - sizer->Add(10, 10, 0, f) \ + wxScopedPtr item(new wxSizerItem(10, 10, 0, f)); \ + sizer->Add(item.get()); \ + item.release() \ ) #define ASSERT_SIZER_INCOMPATIBLE_FLAGS(f1, f2) \