~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/cppunit-1.10.0/examples/cppunittest/TestSetUpTest.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef TESTSETUPTEST_H
 
2
#define TESTSETUPTEST_H
 
3
 
 
4
#include <cppunit/extensions/HelperMacros.h>
 
5
#include <cppunit/extensions/TestSetUp.h>
 
6
 
 
7
 
 
8
class TestSetUpTest : public CPPUNIT_NS::TestFixture
 
9
{
 
10
  CPPUNIT_TEST_SUITE( TestSetUpTest );
 
11
  CPPUNIT_TEST( testRun );
 
12
  CPPUNIT_TEST_SUITE_END();
 
13
 
 
14
public:
 
15
  TestSetUpTest();
 
16
  virtual ~TestSetUpTest();
 
17
 
 
18
  void setUp();
 
19
  void tearDown();
 
20
 
 
21
  void testRun();
 
22
 
 
23
private:
 
24
  class MockSetUp : public CPPUNIT_NS::TestSetUp
 
25
  {
 
26
  public:
 
27
    MockSetUp( CPPUNIT_NS::Test *test )
 
28
        : CPPUNIT_NS::TestSetUp( test )
 
29
        , m_setUpCalled( false )
 
30
        , m_tearDownCalled( false )
 
31
    {
 
32
    }
 
33
 
 
34
    void setUp() 
 
35
    {
 
36
      m_setUpCalled = true;
 
37
    }
 
38
 
 
39
    void tearDown()
 
40
    {
 
41
      m_tearDownCalled = true;
 
42
    }
 
43
 
 
44
    void verify()
 
45
    {
 
46
      CPPUNIT_ASSERT( m_setUpCalled );
 
47
      CPPUNIT_ASSERT( m_tearDownCalled );
 
48
    }
 
49
 
 
50
  private:
 
51
    bool m_setUpCalled;
 
52
    bool m_tearDownCalled;
 
53
  };
 
54
 
 
55
  TestSetUpTest( const TestSetUpTest &copy );
 
56
  void operator =( const TestSetUpTest &copy );
 
57
 
 
58
private:
 
59
};
 
60
 
 
61
 
 
62
 
 
63
#endif  // TESTSETUPTEST_H