X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/890d70ebeaf39ee13012d22751d64d8de070275c..3c01c5951189e13b8b4a5d7b288b54d4a57a30f8:/tests/events/evthandler.cpp diff --git a/tests/events/evthandler.cpp b/tests/events/evthandler.cpp index 0f49b1a179..366fb8e775 100644 --- a/tests/events/evthandler.cpp +++ b/tests/events/evthandler.cpp @@ -309,6 +309,19 @@ void EvtHandlerTestCase::BindFunctor() handler.Bind( MyEventType, functor, 0, 0 ); handler.Unbind( MyEventType, functor, 0, 0 ); + + // test that a temporary functor is working as well and also test that + // unbinding a different (though equal) instance of the same functor does + // not work + MyFunctor func; + handler.Bind( MyEventType, MyFunctor() ); + CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func )); + + handler.Bind( MyEventType, MyFunctor(), 0 ); + CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func, 0 )); + + handler.Bind( MyEventType, MyFunctor(), 0, 0 ); + CPPUNIT_ASSERT( !handler.Unbind( MyEventType, func, 0, 0 )); } void EvtHandlerTestCase::BindMethod()