?? _helper_macros_8h-source.html
字號:
<html><head><title>CppUnit - The Unit Testing Library</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/cppunit"> CppUnit project page </a> </td> <td> <a href="FAQ">FAQ</a> </td> <td width="40%" align="right" valign="center"> <a href="http://cppunit.sourceforge.net">CppUnit home page</a> </td> </tr></table><hr><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>HelperMacros.h</h1><a href="_helper_macros_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">// //////////////////////////////////////////////////////////////////////////</span>00002 <span class="comment">// Header file HelperMacros.h</span>00003 <span class="comment">// (c)Copyright 2000, Baptiste Lepilleur.</span>00004 <span class="comment">// Created: 2001/04/15</span>00005 <span class="comment">// //////////////////////////////////////////////////////////////////////////</span>00006 <span class="preprocessor">#ifndef CPPUNIT_EXTENSIONS_HELPERMACROS_H</span>00007 <span class="preprocessor"></span><span class="preprocessor">#define CPPUNIT_EXTENSIONS_HELPERMACROS_H</span>00008 <span class="preprocessor"></span>00009 <span class="preprocessor">#include <<a class="code" href="_test_caller_8h.html">cppunit/TestCaller.h</a>></span>00010 <span class="preprocessor">#include <<a class="code" href="_test_suite_8h.html">cppunit/TestSuite.h</a>></span>00011 <span class="preprocessor">#include <<a class="code" href="_auto_register_suite_8h.html">cppunit/extensions/AutoRegisterSuite.h</a>></span>00012 <span class="preprocessor">#include <<a class="code" href="_exception_test_case_decorator_8h.html">cppunit/extensions/ExceptionTestCaseDecorator.h</a>></span>00013 <span class="preprocessor">#include <<a class="code" href="_test_fixture_factory_8h.html">cppunit/extensions/TestFixtureFactory.h</a>></span>00014 <span class="preprocessor">#include <<a class="code" href="_test_namer_8h.html">cppunit/extensions/TestNamer.h</a>></span>00015 <span class="preprocessor">#include <<a class="code" href="_test_suite_builder_context_8h.html">cppunit/extensions/TestSuiteBuilderContext.h</a>></span>00016 <span class="preprocessor">#include <memory></span>00017 00018 <a name="l00100"></a><a class="code" href="group___writing_test_fixture.html#ga0">00100</a> <span class="preprocessor">#define CPPUNIT_TEST_SUITE( ATestFixtureType ) \</span>00101 <span class="preprocessor"> public: \</span>00102 <span class="preprocessor"> typedef ATestFixtureType TestFixtureType; \</span>00103 <span class="preprocessor"> \</span>00104 <span class="preprocessor"> private: \</span>00105 <span class="preprocessor"> static const CPPUNIT_NS::TestNamer &getTestNamer__() \</span>00106 <span class="preprocessor"> { \</span>00107 <span class="preprocessor"> static CPPUNIT_TESTNAMER_DECL( testNamer, ATestFixtureType ); \</span>00108 <span class="preprocessor"> return testNamer; \</span>00109 <span class="preprocessor"> } \</span>00110 <span class="preprocessor"> \</span>00111 <span class="preprocessor"> public: \</span>00112 <span class="preprocessor"> typedef CPPUNIT_NS::TestSuiteBuilderContext<TestFixtureType> \</span>00113 <span class="preprocessor"> TestSuiteBuilderContextType; \</span>00114 <span class="preprocessor"> \</span>00115 <span class="preprocessor"> static void \</span>00116 <span class="preprocessor"> addTestsToSuite( CPPUNIT_NS::TestSuiteBuilderContextBase &baseContext ) \</span>00117 <span class="preprocessor"> { \</span>00118 <span class="preprocessor"> TestSuiteBuilderContextType context( baseContext )</span>00119 <span class="preprocessor"></span>00120 <a name="l00151"></a><a class="code" href="group___writing_test_fixture.html#ga1">00151</a> <span class="preprocessor">#define CPPUNIT_TEST_SUB_SUITE( ATestFixtureType, ASuperClass ) \</span>00152 <span class="preprocessor"> public: \</span>00153 <span class="preprocessor"> typedef ASuperClass ParentTestFixtureType; \</span>00154 <span class="preprocessor"> private: \</span>00155 <span class="preprocessor"> CPPUNIT_TEST_SUITE( ATestFixtureType ); \</span>00156 <span class="preprocessor"> ParentTestFixtureType::addTestsToSuite( baseContext )</span>00157 <span class="preprocessor"></span>00158 <a name="l00166"></a><a class="code" href="group___writing_test_fixture.html#ga2">00166</a> <span class="preprocessor">#define CPPUNIT_TEST_SUITE_END() \</span>00167 <span class="preprocessor"> } \</span>00168 <span class="preprocessor"> \</span>00169 <span class="preprocessor"> static CPPUNIT_NS::TestSuite *suite() \</span>00170 <span class="preprocessor"> { \</span>00171 <span class="preprocessor"> const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \</span>00172 <span class="preprocessor"> std::auto_ptr<CPPUNIT_NS::TestSuite> suite( \</span>00173 <span class="preprocessor"> new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \</span>00174 <span class="preprocessor"> CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \</span>00175 <span class="preprocessor"> CPPUNIT_NS::TestSuiteBuilderContextBase context( *suite.get(), \</span>00176 <span class="preprocessor"> namer, \</span>00177 <span class="preprocessor"> factory ); \</span>00178 <span class="preprocessor"> TestFixtureType::addTestsToSuite( context ); \</span>00179 <span class="preprocessor"> return suite.release(); \</span>00180 <span class="preprocessor"> } \</span>00181 <span class="preprocessor"> private: </span><span class="comment">/* dummy typedef so that the macro can still end with ';'*/</span> \00182 typedef int CppUnitDummyTypedefForSemiColonEnding__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -