Revision 418, 0.7 kB
(checked in by vbarta, 15 years ago)
|
#27: added UnitTest?++ to bdm sources, changed test_user_data to use it
|
Line | |
---|
1 | #ifndef UNITTEST_TIMECONSTRAINT_H |
---|
2 | #define UNITTEST_TIMECONSTRAINT_H |
---|
3 | |
---|
4 | #include "TimeHelpers.h" |
---|
5 | |
---|
6 | namespace UnitTest { |
---|
7 | |
---|
8 | class TestResults; |
---|
9 | class TestDetails; |
---|
10 | |
---|
11 | class TimeConstraint |
---|
12 | { |
---|
13 | public: |
---|
14 | TimeConstraint(int ms, TestDetails const& details); |
---|
15 | ~TimeConstraint(); |
---|
16 | |
---|
17 | private: |
---|
18 | void operator=(TimeConstraint const&); |
---|
19 | TimeConstraint(TimeConstraint const&); |
---|
20 | |
---|
21 | Timer m_timer; |
---|
22 | TestDetails const& m_details; |
---|
23 | int const m_maxMs; |
---|
24 | }; |
---|
25 | |
---|
26 | #define UNITTEST_TIME_CONSTRAINT(ms) \ |
---|
27 | UnitTest::TimeConstraint unitTest__timeConstraint__(ms, UnitTest::TestDetails(m_details, __LINE__)) |
---|
28 | |
---|
29 | #define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) |
---|
30 | |
---|
31 | } |
---|
32 | |
---|
33 | #endif |
---|