source: rrlib_util/tUnitTestSuite.h @ 87:87326432bf85

Last change on this file since 87:87326432bf85 was 87:87326432bf85, checked in by Michael Arndt <m_arndt@…>, 7 years ago

Corrected _MESSAGE macro for RRLIB_UNIT_TESTS_EQUALITY_DOUBLE_MESSAGE

File size: 3.8 KB
Line 
1//
2// You received this file as part of RRLib
3// Robotics Research Library
4//
5// Copyright (C) Finroc GbR (finroc.org)
6//
7// This program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public License
9// as published by the Free Software Foundation; either version 2
10// of the License, or (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20//
21//----------------------------------------------------------------------
22/*!\file    rrlib/util/tUnitTestSuite.h
23 *
24 * \author  Tobias Foehst
25 *
26 * \date    2011-03-24
27 *
28 * \brief
29 *
30 * \b
31 *
32 */
33//----------------------------------------------------------------------
34#ifndef __rrlib__util__tUnitTestSuite_h__
35#define __rrlib__util__tUnitTestSuite_h__
36
37//----------------------------------------------------------------------
38// External includes (system with <>, local with "")
39//----------------------------------------------------------------------
40#include <cppunit/TestFixture.h>
41#include <cppunit/extensions/HelperMacros.h>
42
43//----------------------------------------------------------------------
44// Internal includes with ""
45//----------------------------------------------------------------------
46
47//----------------------------------------------------------------------
48// Debugging
49//----------------------------------------------------------------------
50
51//----------------------------------------------------------------------
52// Namespace declaration
53//----------------------------------------------------------------------
54namespace rrlib
55{
56namespace util
57{
58
59//----------------------------------------------------------------------
60// Forward declarations / typedefs / enums
61//----------------------------------------------------------------------
62#define RRLIB_UNIT_TESTS_REGISTER_SUITE(suite_typename) CPPUNIT_TEST_SUITE_REGISTRATION(suite_typename)
63#define RRLIB_UNIT_TESTS_BEGIN_SUITE(suite_typename) CPPUNIT_TEST_SUITE(suite_typename)
64#define RRLIB_UNIT_TESTS_ADD_TEST(test_function_name) CPPUNIT_TEST(test_function_name)
65#define RRLIB_UNIT_TESTS_END_SUITE CPPUNIT_TEST_SUITE_END()
66
67#define RRLIB_UNIT_TESTS_ASSERT(expression) CPPUNIT_ASSERT(expression)
68#define RRLIB_UNIT_TESTS_ASSERT_MESSAGE(msg, expression) CPPUNIT_ASSERT_MESSAGE(msg, expression)
69#define RRLIB_UNIT_TESTS_EQUALITY(a, b) CPPUNIT_ASSERT_EQUAL(a, b)
70#define RRLIB_UNIT_TESTS_EQUALITY_MESSAGE(msg, a, b) CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, a, b)
71#define RRLIB_UNIT_TESTS_EQUALITY_DOUBLE(a, b, delta) CPPUNIT_ASSERT_DOUBLES_EQUAL(a, b, delta)
72#define RRLIB_UNIT_TESTS_EQUALITY_DOUBLE_MESSAGE(msg, a, b, delta) CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msg, a, b, delta)
73#define RRLIB_UNIT_TESTS_EXCEPTION(expression, exception_type) CPPUNIT_ASSERT_THROW(expression, exception_type)
74#define RRLIB_UNIT_TESTS_EXCEPTION_MESSAGE(msg, expression, exception_type) CPPUNIT_ASSERT_THROW_MESSAGE(msg, expression, exception_type)
75
76//----------------------------------------------------------------------
77// Class declaration
78//----------------------------------------------------------------------
79//!
80/*!
81 *
82 */
83class tUnitTestSuite : public CPPUNIT_NS::TestFixture
84{
85
86public:
87
88  void setUp();
89
90  void tearDown();
91
92private:
93
94  virtual void InitializeTests() = 0;
95
96  virtual void CleanUp() = 0;
97
98};
99
100//----------------------------------------------------------------------
101// End of namespace declaration
102//----------------------------------------------------------------------
103}
104}
105
106#endif
Note: See TracBrowser for help on using the repository browser.