Mercurial > fife-parpg
comparison ext/UnitTest++/src/TimeConstraint.h @ 37:0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
author | jasoka@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 12 Jul 2008 12:00:57 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
36:6f1227f4932b | 37:0d325e9d5953 |
---|---|
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, TestResults& result, TestDetails const& details); | |
15 ~TimeConstraint(); | |
16 | |
17 private: | |
18 void operator=(TimeConstraint const&); | |
19 TimeConstraint(TimeConstraint const&); | |
20 | |
21 Timer m_timer; | |
22 TestResults& m_result; | |
23 TestDetails const& m_details; | |
24 int const m_maxMs; | |
25 }; | |
26 | |
27 #define UNITTEST_TIME_CONSTRAINT(ms) \ | |
28 UnitTest::TimeConstraint unitTest__timeConstraint__(ms, testResults_, UnitTest::TestDetails(m_details, __LINE__)) | |
29 | |
30 #define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) | |
31 | |
32 } | |
33 | |
34 #endif |