root/library/tests/unittest-cpp/TimeConstraint.h @ 727

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
6namespace UnitTest {
7
8class TestResults;
9class TestDetails;
10
11class TimeConstraint {
12public:
13        TimeConstraint ( int ms, TestDetails const& details );
14        ~TimeConstraint();
15
16private:
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
Note: See TracBrowser for help on using the browser.