added failing compilation test for the case of missing handler in Bind() call

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-04-16 21:33:37 +00:00
parent 0fe243db0c
commit 48c56e04b0
3 changed files with 7 additions and 2 deletions

View File

@@ -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; \

View File

@@ -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 { };

View File

@@ -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; \