diff --git a/tests/Makefile.in b/tests/Makefile.in index f94f86eab6..92ab213192 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -637,7 +637,7 @@ printfbench_printfbench.o: $(srcdir)/benchmarks/printfbench.cpp $(PRINTFBENCH_OD # fail failtest: @$(RM) test_evthandler.o - @for d in GLOBAL STATIC METHOD FUNCTOR DERIVED WRONG_CLASS; do \ + @for d in GLOBAL STATIC METHOD FUNCTOR NO_HANDLER DERIVED WRONG_CLASS; do \ if $(MAKE) CXXWARNINGS=-DTEST_INVALID_BIND_$$d test_evthandler.o 2>/dev/null; then \ echo "*** Compilation with TEST_INVALID_BIND_$$d unexpectedly succeeded.">&2; \ exit 1; \ diff --git a/tests/events/evthandler.cpp b/tests/events/evthandler.cpp index 309b34442f..f51360a202 100644 --- a/tests/events/evthandler.cpp +++ b/tests/events/evthandler.cpp @@ -381,6 +381,11 @@ void EvtHandlerTestCase::InvalidBind() handler.Bind(MyEventType, f); #endif + // the handler can't be omitted when calling Bind() +#ifdef TEST_INVALID_BIND_NO_HANDLER + handler.Bind(MyEventType, &MyHandler::OnMyEvent); +#endif + // calling a derived class method with a base class pointer must not work #ifdef TEST_INVALID_BIND_DERIVED struct C1 : wxEvtHandler { }; diff --git a/tests/test.bkl b/tests/test.bkl index b78a570a0c..ee4e4a4930 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -176,7 +176,7 @@ # fail failtest: @$(RM) test_evthandler.o - @for d in GLOBAL STATIC METHOD FUNCTOR DERIVED WRONG_CLASS; do \ + @for d in GLOBAL STATIC METHOD FUNCTOR NO_HANDLER DERIVED WRONG_CLASS; do \ if $(MAKE) CXXWARNINGS=-DTEST_INVALID_BIND_$$d test_evthandler.o 2>/dev/null; then \ echo "*** Compilation with TEST_INVALID_BIND_$$d unexpectedly succeeded.">&2; \ exit 1; \