]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/events/evthandler.cpp
Updated all message catalogs to correspond to the current sources.
[wxWidgets.git] / tests / events / evthandler.cpp
index 0f49b1a1791ba2ac8c8d7627e93622a350aee86c..2e5d478c7d5735ae5c6edeb8e8f68c9b9ec1e5aa 100644 (file)
@@ -197,7 +197,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( EvtHandlerTestCase );
 
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( EvtHandlerTestCase, "EvtHandlerTestCase" );
 
 void EvtHandlerTestCase::BuiltinConnect()
@@ -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()