CppUnit project page FAQ CppUnit home page

TestPath.h
Go to the documentation of this file.
1#ifndef CPPUNIT_TESTPATH_H
2#define CPPUNIT_TESTPATH_H
3
5
6#if CPPUNIT_NEED_DLL_DECL
7#pragma warning( push )
8#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
9#endif
10
12#include <string>
13
15
16
17class Test;
18
19#if CPPUNIT_NEED_DLL_DECL
20// template class CPPUNIT_API std::deque<Test *>;
21#endif
22
23
35{
36public:
41 TestPath();
42
47 TestPath( Test *root );
48
56 TestPath( const TestPath &otherPath,
57 int indexFirst,
58 int count = -1 );
59
75 TestPath( Test *searchRoot,
76 const std::string &pathAsString );
77
81 TestPath( const TestPath &other );
82
83 virtual ~TestPath();
84
88 virtual bool isValid() const;
89
93 virtual void add( Test *test );
94
98 virtual void add( const TestPath &path );
99
105 virtual void insert( Test *test, int index );
106
113 virtual void insert( const TestPath &path, int index );
114
119 virtual void removeTests();
120
125 virtual void removeTest( int index );
126
131 virtual void up();
132
136 virtual int getTestCount() const;
137
143 virtual Test *getTestAt( int index ) const;
144
149 virtual Test *getChildTest() const;
150
161 virtual std::string toString() const;
162
167 TestPath &operator =( const TestPath &other );
168
169protected:
174 void checkIndexValid( int index ) const;
175
178
185 bool splitPathString( const std::string &pathAsString,
186 PathTestNames &testNames );
187
197 Test *findActualRoot( Test *searchRoot,
198 const std::string &pathAsString,
199 PathTestNames &testNames );
200
201protected:
204
205};
206
207
209
210#endif // CPPUNIT_TESTPATH_H
211
#define CPPUNIT_API
Definition CppUnitApi.h:27
#define CppUnitDeque
Definition CppUnitDeque.h:20
#define CPPUNIT_NS_END
Definition Portability.h:120
#define CPPUNIT_NS_BEGIN
Definition Portability.h:119
Base class for all test objects.
Definition Test.h:26
void checkIndexValid(int index) const
Checks that the specified test index is within valid range.
Definition TestPath.cpp:181
virtual Test * getChildTest() const
Get the last test of the path.
Definition TestPath.cpp:174
Test * findActualRoot(Test *searchRoot, const std::string &pathAsString, PathTestNames &testNames)
Finds the actual root of a path string and get the path string name components.
Definition TestPath.cpp:204
CppUnitDeque< std::string > PathTestNames
A list of test names.
Definition TestPath.h:177
TestPath()
Constructs an invalid path.
Definition TestPath.cpp:10
virtual void removeTest(int index)
Removes the test at the specified index of the path.
Definition TestPath.cpp:143
bool splitPathString(const std::string &pathAsString, PathTestNames &testNames)
Splits a path string into its test name components.
Definition TestPath.cpp:226
virtual void add(Test *test)
Adds a test to the path.
Definition TestPath.cpp:101
CppUnitDeque< Test * > Tests
Definition TestPath.h:202
virtual void up()
Removes the last test.
Definition TestPath.cpp:151
virtual void removeTests()
Removes all the test from the path.
Definition TestPath.cpp:135
virtual std::string toString() const
Returns the path as a string.
Definition TestPath.cpp:189
virtual Test * getTestAt(int index) const
Returns the test of the specified index.
Definition TestPath.cpp:166
Tests m_tests
Definition TestPath.h:203
virtual int getTestCount() const
Returns the number of tests in the path.
Definition TestPath.cpp:159
virtual bool isValid() const
Tests if the path contains at least one test.
Definition TestPath.cpp:94
virtual void insert(Test *test, int index)
Inserts a test at the specified index.
Definition TestPath.cpp:116

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers