File: test_template.cc

package info (click to toggle)
scrm 1.7.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,936 kB
  • sloc: cpp: 7,965; sh: 3,190; python: 897; ansic: 234; makefile: 72
file content (36 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * A sample test case which can be used as a template.
 */
#include <cppunit/TestCase.h>
#include <cppunit/extensions/HelperMacros.h>


class MyTest : public CppUnit::TestCase {

	CPPUNIT_TEST_SUITE( MyTest );

	CPPUNIT_TEST( testOneThing );
	CPPUNIT_TEST( testAnother );
	CPPUNIT_TEST( testException );

	CPPUNIT_TEST_SUITE_END();

	public:
		void testOneThing() {
			CPPUNIT_ASSERT( 1 == 1 );
			CPPUNIT_ASSERT_MESSAGE("error message", 1 == 1 );
		}
		
		void testAnother() {
			CPPUNIT_ASSERT_EQUAL(1, 1);
		}

		void testException() {
			CPPUNIT_ASSERT( 1 == 1 );
		//	CPPUNIT_ASSERT_THROW(
		//		throw std::exception(), std::exception );
		}
};

//Uncomment this to activate the test
//CPPUNIT_TEST_SUITE_REGISTRATION( MyTest );