From 3820593bb8dfdca4e2e17c70b278065b7f7894d9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Mar 2006 10:25:48 +0000 Subject: bringing cxxtest-3.10.1 to ScummVM's main branch svn-id: r21488 --- test/cxxtest/sample/FixtureTest.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/cxxtest/sample/FixtureTest.h (limited to 'test/cxxtest/sample/FixtureTest.h') 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 +#include + +// +// 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 -- cgit v1.2.3