2 #include "wx/cppunit.h"
4 // define wxHAVE_U_ESCAPE if the compiler supports \uxxxx character constants
5 #if (defined(__VISUALC__) && (__VISUALC__ >= 1300)) || \
6 (defined(__GNUC__) && (__GNUC__ >= 3))
7 #define wxHAVE_U_ESCAPE
10 // thrown when assert fails in debug build
11 class TestAssertFailure
{ };
13 // macro to use for the functions which are supposed to fail an assertion
15 // some old cppunit versions don't define CPPUNIT_ASSERT_THROW so roll our
17 #define WX_ASSERT_FAILS_WITH_ASSERT(cond) \
19 bool throwsAssert = false; \
21 catch ( const TestAssertFailure& ) { throwsAssert = true; } \
22 if ( !throwsAssert ) \
23 CPPUNIT_FAIL("expected assertion not generated"); \
26 // there are no assertions in this build so just check that it fails
27 #define WX_ASSERT_FAILS_WITH_ASSERT(cond) CPPUNIT_ASSERT(!(cond))
30 // these functions can be used to hook into wxApp event processing and are
31 // currently used by the events propagation test
32 class WXDLLIMPEXP_FWD_BASE wxEvent
;
34 typedef int (*FilterEventFunc
)(wxEvent
&);
35 typedef bool (*ProcessEventFunc
)(wxEvent
&);
37 extern void SetFilterEventFunc(FilterEventFunc func
);
38 extern void SetProcessEventFunc(ProcessEventFunc func
);