Code

Fixed const/non-const mismatch loop.
[inkscape.git] / cxxtest / sample / FixtureTest.h
1 #ifndef __FIXTURETEST_H
2 #define __FIXTURETEST_H
4 #include <cxxtest/TestSuite.h>
5 #include <string.h>
7 //
8 // This test suite shows how to use setUp() and tearDown()
9 // to initialize data common to all tests.
10 // setUp()/tearDown() will be called before and after each
11 // test.
12 //
14 class FixtureTest : public CxxTest::TestSuite
15 {
16     char *_buffer;
17 public:
18     void setUp()
19     {
20         _buffer = new char[1024];
21     }
22     
23     void tearDown()
24     {
25         delete [] _buffer;
26     }
28     void test_strcpy()
29     {
30         strcpy( _buffer, "Hello, world!" );
31         TS_ASSERT_EQUALS( _buffer[0], 'H' );
32         TS_ASSERT_EQUALS( _buffer[1], 'E' );
33     }
34 };
37 #endif // __FIXTURETEST_H