~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/include/cppunit/extensions/TestFixtureFactory.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
 
2
#define CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
 
3
 
 
4
#include <cppunit/Portability.h>
 
5
 
 
6
 
 
7
CPPUNIT_NS_BEGIN
 
8
 
 
9
 
 
10
class TestFixture;
 
11
 
 
12
/*! \brief Abstract TestFixture factory (Implementation).
 
13
 *
 
14
 * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
 
15
 */
 
16
class TestFixtureFactory
 
17
{
 
18
public:
 
19
  //! Creates a new TestFixture instance.
 
20
  virtual TestFixture *makeFixture() =0;
 
21
 
 
22
  virtual ~TestFixtureFactory() {}
 
23
};
 
24
 
 
25
 
 
26
/*! \brief Concret TestFixture factory (Implementation).
 
27
 *
 
28
 * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
 
29
 */
 
30
template<class TestFixtureType>
 
31
class ConcretTestFixtureFactory : public CPPUNIT_NS::TestFixtureFactory
 
32
{
 
33
  /*! \brief Returns a new TestFixture instance.
 
34
   * \return A new fixture instance. The fixture instance is returned by
 
35
   *         the TestFixtureFactory passed on construction. The actual type 
 
36
   *         is that of the fixture on which the static method suite() 
 
37
   *         was called.
 
38
   */
 
39
  TestFixture *makeFixture()
 
40
  {
 
41
    return new TestFixtureType();
 
42
  }
 
43
};
 
44
 
 
45
 
 
46
CPPUNIT_NS_END
 
47
 
 
48
 
 
49
#endif // CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
 
50