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
14 TestAssertFailure(const wxString
& file
,
27 const wxString m_file
;
29 const wxString m_func
;
30 const wxString m_cond
;
33 wxDECLARE_NO_ASSIGN_CLASS(TestAssertFailure
);
36 // macro to use for the functions which are supposed to fail an assertion
38 // some old cppunit versions don't define CPPUNIT_ASSERT_THROW so roll our
40 #define WX_ASSERT_FAILS_WITH_ASSERT(cond) \
42 bool throwsAssert = false; \
44 catch ( const TestAssertFailure& ) { throwsAssert = true; } \
45 if ( !throwsAssert ) \
46 CPPUNIT_FAIL("expected assertion not generated"); \
49 // there are no assertions in this build so just check that it fails
50 #define WX_ASSERT_FAILS_WITH_ASSERT(cond) CPPUNIT_ASSERT(!(cond))
53 // these functions can be used to hook into wxApp event processing and are
54 // currently used by the events propagation test
55 class WXDLLIMPEXP_FWD_BASE wxEvent
;
57 typedef int (*FilterEventFunc
)(wxEvent
&);
58 typedef bool (*ProcessEventFunc
)(wxEvent
&);
60 extern void SetFilterEventFunc(FilterEventFunc func
);
61 extern void SetProcessEventFunc(ProcessEventFunc func
);