Revision 706, 0.7 kB
(checked in by smidl, 15 years ago)
|
eol-native
|
-
Property svn:eol-style set to
native
|
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 | public: |
---|
13 | TimeConstraint ( int ms, TestDetails const& details ); |
---|
14 | ~TimeConstraint(); |
---|
15 | |
---|
16 | private: |
---|
17 | void operator= ( TimeConstraint const& ); |
---|
18 | TimeConstraint ( TimeConstraint const& ); |
---|
19 | |
---|
20 | Timer m_timer; |
---|
21 | TestDetails const& m_details; |
---|
22 | int const m_maxMs; |
---|
23 | }; |
---|
24 | |
---|
25 | #define UNITTEST_TIME_CONSTRAINT(ms) \ |
---|
26 | UnitTest::TimeConstraint unitTest__timeConstraint__(ms, UnitTest::TestDetails(m_details, __LINE__)) |
---|
27 | |
---|
28 | #define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) |
---|
29 | |
---|
30 | } |
---|
31 | |
---|
32 | #endif |
---|