diff options
author | Max Horn | 2006-03-29 10:25:48 +0000 |
---|---|---|
committer | Max Horn | 2006-03-29 10:25:48 +0000 |
commit | 3820593bb8dfdca4e2e17c70b278065b7f7894d9 (patch) | |
tree | df3e8bebda3abcd99d0882dc9e8c6410f86850fb /test/cxxtest/sample/FixtureTest.h | |
parent | 9c94670e22cb68e32fd38c0d2b009539e35d4a71 (diff) | |
download | scummvm-rg350-3820593bb8dfdca4e2e17c70b278065b7f7894d9.tar.gz scummvm-rg350-3820593bb8dfdca4e2e17c70b278065b7f7894d9.tar.bz2 scummvm-rg350-3820593bb8dfdca4e2e17c70b278065b7f7894d9.zip |
bringing cxxtest-3.10.1 to ScummVM's main branch
svn-id: r21488
Diffstat (limited to 'test/cxxtest/sample/FixtureTest.h')
-rw-r--r-- | test/cxxtest/sample/FixtureTest.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/cxxtest/sample/FixtureTest.h b/test/cxxtest/sample/FixtureTest.h new file mode 100644 index 0000000000..653c7a14ae --- /dev/null +++ b/test/cxxtest/sample/FixtureTest.h @@ -0,0 +1,37 @@ +#ifndef __FIXTURETEST_H +#define __FIXTURETEST_H + +#include <cxxtest/TestSuite.h> +#include <string.h> + +// +// This test suite shows how to use setUp() and tearDown() +// to initialize data common to all tests. +// setUp()/tearDown() will be called before and after each +// test. +// + +class FixtureTest : public CxxTest::TestSuite +{ + char *_buffer; +public: + void setUp() + { + _buffer = new char[1024]; + } + + void tearDown() + { + delete [] _buffer; + } + + void test_strcpy() + { + strcpy( _buffer, "Hello, world!" ); + TS_ASSERT_EQUALS( _buffer[0], 'H' ); + TS_ASSERT_EQUALS( _buffer[1], 'E' ); + } +}; + + +#endif // __FIXTURETEST_H |