@@ -24,12 +24,17 @@ namespace
24
24
virtual void RunImpl () const
25
25
{
26
26
TestResults& testResults_ = *CurrentTest::Results ();
27
+
27
28
for (int i=0 ; i < count; ++i)
28
29
{
29
30
if (asserted)
31
+ {
30
32
ReportAssert (" desc" , " file" , 0 );
33
+ }
31
34
else if (!success)
35
+ {
32
36
testResults_.OnTestFailure (m_details, " message" );
37
+ }
33
38
}
34
39
}
35
40
@@ -38,8 +43,13 @@ namespace
38
43
int const count;
39
44
};
40
45
41
- struct FixtureBase {
42
- explicit FixtureBase () : runner(reporter) { }
46
+ struct FixtureBase
47
+ {
48
+ FixtureBase ()
49
+ : runner(reporter)
50
+ {
51
+ }
52
+
43
53
template <class Predicate >
44
54
int RunTestsIf (TestList const & list, char const * suiteName,
45
55
const Predicate& predicate, int maxTestTimeInMs)
@@ -51,6 +61,7 @@ namespace
51
61
CurrentTest::Details () = oldDetails;
52
62
return result;
53
63
}
64
+
54
65
TestRunner runner;
55
66
RecordingReporter reporter;
56
67
};
@@ -83,7 +94,11 @@ namespace
83
94
class SlowTest : public Test
84
95
{
85
96
public:
86
- SlowTest () : Test(" slow" , " somesuite" , " filename" , 123 ) {}
97
+ SlowTest ()
98
+ : Test(" slow" , " somesuite" , " filename" , 123 )
99
+ {
100
+ }
101
+
87
102
virtual void RunImpl () const
88
103
{
89
104
TimeHelpers::SleepMs (20 );
@@ -277,7 +292,7 @@ namespace
277
292
Test fail (" fail" );
278
293
279
294
CHECK (predicate (&pass));
280
- CHECK (!predicate (&fail));
295
+ CHECK (!predicate (&fail));
281
296
}
282
297
283
298
TEST_FIXTURE (TestRunnerFixture, TestRunnerRunsTestsThatPassPredicate)
0 commit comments