Adapts a service that declares tests to the IUnitTest interface. More...
#include <arcane/core/UnitTestServiceAdapter.h>
Classes | |
| struct | TestFuncInfo |
Public Types | |
| typedef void(T::* | FuncPtr) () |
| Type of the pointer to the test methods. | |
Public Member Functions | |
| UnitTestServiceAdapter (T *service) | |
| void | setClassSetUpFunction (FuncPtr f) |
| void | setTestSetUpFunction (FuncPtr f) |
| void | setClassTearDownFunction (FuncPtr f) |
| void | setTestTearDownFunction (FuncPtr f) |
| void | addTestFunction (FuncPtr f, String name, String method_name) |
| void | initializeTest () override |
| Implementation of the IUnitTest interface. | |
| bool | executeTest (XmlNode &report) override |
| Implementation of the IUnitTest interface. | |
| void | finalizeTest () override |
| Implementation of the IUnitTest interface. | |
| Public Member Functions inherited from Arcane::IXmlUnitTest | |
| virtual void | buildInitializeTest () |
| Public Member Functions inherited from Arcane::Assertion | |
| void | fail (const TraceInfo &where) |
| void | assertTrue (const TraceInfo &where, bool condition, IParallelMng *pm=nullptr) |
| Throws an AssertException if condition is false. | |
| void | assertFalse (const TraceInfo &where, bool condition, IParallelMng *pm=nullptr) |
| Throws an AssertException if condition is true. | |
| void | assertEqual (const TraceInfo &where, const String &expected, const String &actual, IParallelMng *pm=nullptr) |
| template<typename T> | |
| void | assertEqual (const TraceInfo &where, const T &expected, const T &actual, IParallelMng *pm=nullptr) |
| template<typename T> | |
| void | assertNearlyEqual (const TraceInfo &where, const T &expected, const T &actual, IParallelMng *pm=nullptr) |
| template<typename T> | |
| void | assertNearlyZero (const TraceInfo &where, const T &actual, IParallelMng *pm=nullptr) |
| template<typename T> | |
| void | assertNearlyEqualWithEpsilon (const TraceInfo &where, const T &expected, const T &actual, const T &epsilon, IParallelMng *pm=nullptr) |
| template<typename T> | |
| void | assertNearlyZeroWithEpsilon (const TraceInfo &where, const T &actual, const T &epsilon, IParallelMng *pm=nullptr) |
Private Attributes | |
| FuncPtr | m_class_set_up_function = nullptr |
| Pointer to the class initialization method. | |
| FuncPtr | m_set_up_function = nullptr |
| Pointer to the initialization method of each test. | |
| FuncPtr | m_class_tear_down_function = nullptr |
| Pointer to the class teardown method. | |
| FuncPtr | m_tear_down_function = nullptr |
| Pointer to the teardown method of each test. | |
| UniqueArray< TestFuncInfo > | m_test_functions |
| Associated service. | |
| T * | m_service |
Adapts a service that declares tests to the IUnitTest interface.
Definition at line 37 of file UnitTestServiceAdapter.h.
| typedef void(T::* Arcane::UnitTestServiceAdapter< T >::FuncPtr) () |
Type of the pointer to the test methods.
Definition at line 43 of file UnitTestServiceAdapter.h.
|
inlineexplicit |
Definition at line 47 of file UnitTestServiceAdapter.h.
|
inline |
Definition at line 57 of file UnitTestServiceAdapter.h.
|
inlineoverridevirtual |
Implementation of the IUnitTest interface.
Implements Arcane::IXmlUnitTest.
Definition at line 73 of file UnitTestServiceAdapter.h.
References Arcane::AssertionException::file(), Arcane::AssertionException::line(), m_set_up_function, m_tear_down_function, m_test_functions, Arcane::AssertionException::message(), Arcane::XmlNode::setAttrValue(), and Arcane::AssertionException::where().
|
inlineoverridevirtual |
Implementation of the IUnitTest interface.
Implements Arcane::IXmlUnitTest.
Definition at line 106 of file UnitTestServiceAdapter.h.
References m_class_tear_down_function.
|
inlineoverridevirtual |
Implementation of the IUnitTest interface.
Implements Arcane::IXmlUnitTest.
Definition at line 66 of file UnitTestServiceAdapter.h.
References m_class_set_up_function.
|
inline |
Definition at line 53 of file UnitTestServiceAdapter.h.
|
inline |
Definition at line 55 of file UnitTestServiceAdapter.h.
|
inline |
Definition at line 54 of file UnitTestServiceAdapter.h.
|
inline |
Definition at line 56 of file UnitTestServiceAdapter.h.
|
private |
Pointer to the class initialization method.
Definition at line 130 of file UnitTestServiceAdapter.h.
Referenced by initializeTest().
|
private |
Pointer to the class teardown method.
Definition at line 134 of file UnitTestServiceAdapter.h.
Referenced by finalizeTest().
|
private |
Definition at line 140 of file UnitTestServiceAdapter.h.
|
private |
Pointer to the initialization method of each test.
Definition at line 132 of file UnitTestServiceAdapter.h.
Referenced by executeTest().
|
private |
Pointer to the teardown method of each test.
Pointers to the test methods.
Definition at line 136 of file UnitTestServiceAdapter.h.
Referenced by executeTest().
|
private |
Associated service.
Definition at line 138 of file UnitTestServiceAdapter.h.
Referenced by executeTest().