]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/events/evthandler.cpp
implement wxTreeCtrl::GetFocusedItem() for wxMSW too (see #10859)
[wxWidgets.git] / tests / events / evthandler.cpp
index 0f49b1a1791ba2ac8c8d7627e93622a350aee86c..366fb8e7758a7b0673dc272b583884102cac0716 100644 (file)
@@ -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()