Revision 6:ba3c8cc649d3 TestDefaults.cpp
| TestDefaults.cpp | ||
|---|---|---|
| 46 | 46 |
using namespace std; |
| 47 | 47 |
|
| 48 | 48 |
#include <cmath> |
| 49 |
#include <time.h> |
|
| 49 | 50 |
|
| 50 | 51 |
Tester::TestRegistrar<TestDefaultProgram> |
| 51 | 52 |
TestDefaultProgram::m_registrar("E1 Inconsistent default program");
|
| ... | ... | |
| 53 | 54 |
Tester::TestRegistrar<TestDefaultParameters> |
| 54 | 55 |
TestDefaultParameters::m_registrar("E2 Inconsistent default parameters");
|
| 55 | 56 |
|
| 57 |
Tester::TestRegistrar<TestLengthyConstructor> |
|
| 58 |
TestLengthyConstructor::m_registrar("E3 Lengthy constructor");
|
|
| 59 |
|
|
| 56 | 60 |
static const size_t _step = 1000; |
| 57 | 61 |
|
| 58 | 62 |
Test::Results |
| ... | ... | |
| 140 | 144 |
|
| 141 | 145 |
return r; |
| 142 | 146 |
} |
| 147 |
|
|
| 148 |
Test::Results |
|
| 149 |
TestLengthyConstructor::test(string key) |
|
| 150 |
{
|
|
| 151 |
time_t t0 = time(0); |
|
| 152 |
auto_ptr<Plugin> p(load(key)); |
|
| 153 |
time_t t1 = time(0); |
|
| 154 |
Results r; |
|
| 155 |
if (t1 - t0 > 1) r.push_back(warning("Constructor takes some time to run: work should be deferred to initialise?"));
|
|
| 156 |
return r; |
|
| 157 |
} |
|
| 158 |
|
|
Also available in: Unified diff