blob: e854bf38f15745c9b00c236d7e3a1e4c5f84663b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
// //////////////////////////////////////////////////////////////////////////
// Implementation file MostRecentTests.cpp for class MostRecentTests
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2001/06/27
// //////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "MostRecentTests.h"
#include <algorithm>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
MostRecentTests::MostRecentTests()
{
}
MostRecentTests::~MostRecentTests()
{
}
void
MostRecentTests::setLastTestRun( CPPUNIT_NS::Test *test )
{
for ( TestRuns::iterator it = m_runs.begin(); it != m_runs.end(); ++it )
{
if ( it->second == test )
{
m_runs.erase( it );
break;
}
}
if ( test != NULL )
m_runs.push_front( TestRun( test->getName(), test ) );
}
CPPUNIT_NS::Test *
MostRecentTests::lastTestRun() const
{
return m_runs.front().second;
}
int
MostRecentTests::getRunCount() const
{
return m_runs.size();
}
CPPUNIT_NS::Test *
MostRecentTests::getTestAt( int indexTest ) const
{
return m_runs.at( indexTest ).second;
}
std::string
MostRecentTests::getTestNameAt( int indexTest ) const
{
return m_runs.at( indexTest ).first;
}
|