]> git.saurik.com Git - wxWidgets.git/commitdiff
added failing compilation test for the case of missing handler in Bind() call
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 16 Apr 2009 21:33:37 +0000 (21:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 16 Apr 2009 21:33:37 +0000 (21:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/Makefile.in
tests/events/evthandler.cpp
tests/test.bkl

index f94f86eab601b12d081414b462035a50abd9961a..92ab2131929d881a6b8bf9079f1af02fa4587ffe 100644 (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; \
index 309b34442fda853a8e97ee7547f2d4ff34e94ad8..f51360a2020522e3c95175e5367f4aa1f55eb42d 100644 (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 { };
index b78a570a0cf719e65513865e251aa13138a8608e..ee4e4a49305feb24a0d653c5078ba245c6ba5233 100644 (file)
 # 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.">&amp;2; \
                exit 1; \