fix errors in EvtHandlerTestCase::BindFunctor() in optimized build: apparently compiler is smart enough to detect that the same object can be used for all temporaries
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -310,18 +310,18 @@ void EvtHandlerTestCase::BindFunctor()
|
|||||||
handler.Bind( MyEventType, functor, 0, 0 );
|
handler.Bind( MyEventType, functor, 0, 0 );
|
||||||
handler.Unbind( MyEventType, functor, 0, 0 );
|
handler.Unbind( MyEventType, functor, 0, 0 );
|
||||||
|
|
||||||
// Test that a temporary functor is working as well. Note that Unbind will
|
// test that a temporary functor is working as well and also test that
|
||||||
// fail because a functor can only be unbound if it is the same instance as
|
// unbinding a different (though equal) instance of the same functor does
|
||||||
// in Bind!
|
// not work
|
||||||
|
MyFunctor func;
|
||||||
handler.Bind( MyEventType, MyFunctor() );
|
handler.Bind( MyEventType, MyFunctor() );
|
||||||
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, MyFunctor() ));
|
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func ));
|
||||||
|
|
||||||
handler.Bind( MyEventType, MyFunctor(), 0 );
|
handler.Bind( MyEventType, MyFunctor(), 0 );
|
||||||
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, MyFunctor(), 0 ));
|
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func, 0 ));
|
||||||
|
|
||||||
handler.Bind( MyEventType, MyFunctor(), 0, 0 );
|
handler.Bind( MyEventType, MyFunctor(), 0, 0 );
|
||||||
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, MyFunctor(), 0, 0 ));
|
CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func, 0, 0 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EvtHandlerTestCase::BindMethod()
|
void EvtHandlerTestCase::BindMethod()
|
||||||
|
Reference in New Issue
Block a user