Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Assertion Class Reference

Base class for assertions in unit tests. More...

#include <arcane/core/Assertion.h>

Public Member Functions

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)

Detailed Description

Base class for assertions in unit tests.

Definition at line 44 of file Assertion.h.

Member Function Documentation

◆ assertEqual() [1/2]

void Arcane::Assertion::assertEqual ( const TraceInfo & where,
const String & expected,
const String & actual,
IParallelMng * pm = nullptr )
inline

Overload for character strings. This allows comparing String with 'const char*' for example.

Definition at line 76 of file Assertion.h.

◆ assertEqual() [2/2]

template<typename T>
void Arcane::Assertion::assertEqual ( const TraceInfo & where,
const T & expected,
const T & actual,
IParallelMng * pm = nullptr )
inline

Definition at line 84 of file Assertion.h.

◆ assertFalse()

void Arcane::Assertion::assertFalse ( const TraceInfo & where,
bool condition,
IParallelMng * pm = nullptr )
inline

Throws an AssertException if condition is true.

Definition at line 66 of file Assertion.h.

◆ assertNearlyEqual()

template<typename T>
void Arcane::Assertion::assertNearlyEqual ( const TraceInfo & where,
const T & expected,
const T & actual,
IParallelMng * pm = nullptr )
inline

Definition at line 92 of file Assertion.h.

◆ assertNearlyEqualWithEpsilon()

template<typename T>
void Arcane::Assertion::assertNearlyEqualWithEpsilon ( const TraceInfo & where,
const T & expected,
const T & actual,
const T & epsilon,
IParallelMng * pm = nullptr )
inline

Definition at line 107 of file Assertion.h.

◆ assertNearlyZero()

template<typename T>
void Arcane::Assertion::assertNearlyZero ( const TraceInfo & where,
const T & actual,
IParallelMng * pm = nullptr )
inline

Definition at line 100 of file Assertion.h.

◆ assertNearlyZeroWithEpsilon()

template<typename T>
void Arcane::Assertion::assertNearlyZeroWithEpsilon ( const TraceInfo & where,
const T & actual,
const T & epsilon,
IParallelMng * pm = nullptr )
inline

Definition at line 115 of file Assertion.h.

◆ assertTrue()

void Arcane::Assertion::assertTrue ( const TraceInfo & where,
bool condition,
IParallelMng * pm = nullptr )
inline

Throws an AssertException if condition is false.

Definition at line 59 of file Assertion.h.

◆ fail()

void Arcane::Assertion::fail ( const TraceInfo & where)
inline

Definition at line 53 of file Assertion.h.


The documentation for this class was generated from the following files: