Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Assertion.h File Reference
#include "arcane/utils/TraceInfo.h"
#include "arcane/utils/Numeric.h"
#include "arcane/core/ArcaneTypes.h"
#include "arcane/core/ArcaneException.h"
Include dependency graph for Assertion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Arcane::Assertion
 Base class for assertions in unit tests. More...

Namespaces

namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --

Macros

#define FAIL   fail(A_FUNCINFO)
#define ASSERT_TRUE(condition)
 Checks that condition is true.
#define PARALLEL_ASSERT_TRUE(condition, parallel_mng)
 Checks in parallel that condition is true.
#define ASSERT_FALSE(condition)
 Checks that condition is false.
#define PARALLEL_ASSERT_FALSE(condition, parallel_mng)
 Checks that condition is false.
#define ASSERT_EQUAL(expected, actual)
 Checks that expected and actual are equal. The comparison is done via the type's ==() operator.
#define PARALLEL_ASSERT_EQUAL(expected, actual, parallel_mng)
 Checks that expected and actual are equal. The comparison is done via the type's ==() operator.
#define ASSERT_NEARLY_EQUAL(expected, actual)
 Checks that expected and actual are nearly equal.
#define PARALLEL_ASSERT_NEARLY_EQUAL(expected, actual, parallel_mng)
 Checks that expected and actual are nearly equal.
#define ASSERT_NEARLY_ZERO(actual)
 Checks that actual is almost equal to zero using the standard epsilon.
#define PARALLEL_ASSERT_NEARLY_ZERO(actual, parallel_mng)
 Checks that actual is almost equal to zero using the standard epsilon.
#define ASSERT_NEARLY_EQUAL_EPSILON(expected, actual, epsilon)
 Checks that expected and actual are nearly equal.
#define PARALLEL_ASSERT_NEARLY_EQUAL_EPSILON(expected, actual, epsilon, parallel_mng)
 Checks that expected and actual are nearly equal.
#define ASSERT_NEARLY_ZERO_EPSILON(actual, epsilon)
 Checks that actual is almost equal to zero using the specified epsilon epsilon.
#define PARALLEL_ASSERT_NEARLY_ZERO_EPSILON(actual, epsilon, parallel_mng)
 Checks that actual is almost equal to zero using the specified epsilon epsilon.
#define ASSERT_EQUALS(expected, actual)
 Checks that expected and actual are equal. The comparison is done via the type's ==() operator.
#define ASSERT_NEARLY_EQUALS(expected, actual)
 Checks that expected and actual are nearly equal.

Detailed Description

This file contains the assertions used for unit tests.

Definition in file Assertion.h.

Macro Definition Documentation

◆ ASSERT_EQUAL

#define ASSERT_EQUAL ( expected,
actual )
Value:
assertEqual(A_FUNCINFO, expected, actual)

Checks that expected and actual are equal. The comparison is done via the type's ==() operator.

Definition at line 153 of file Assertion.h.

◆ ASSERT_EQUALS

#define ASSERT_EQUALS ( expected,
actual )
Value:
assertEqual(A_FUNCINFO, expected, actual)

Checks that expected and actual are equal. The comparison is done via the type's ==() operator.

Deprecated
Use ASSERT_EQUAL() (without the S)

Definition at line 228 of file Assertion.h.

◆ ASSERT_FALSE

#define ASSERT_FALSE ( condition)
Value:
assertFalse(A_FUNCINFO, condition)

Checks that condition is false.

Definition at line 140 of file Assertion.h.

◆ ASSERT_NEARLY_EQUAL

#define ASSERT_NEARLY_EQUAL ( expected,
actual )
Value:
assertNearlyEqual(A_FUNCINFO, expected, actual)

Checks that expected and actual are nearly equal.

See also
math::isNearlyEqual()

Definition at line 167 of file Assertion.h.

◆ ASSERT_NEARLY_EQUAL_EPSILON

#define ASSERT_NEARLY_EQUAL_EPSILON ( expected,
actual,
epsilon )
Value:
assertNearlyEqualWithEpsilon(A_FUNCINFO, expected, actual, epsilon)

Checks that expected and actual are nearly equal.

See also
math::isNearlyEqualWithEpsilon()

Definition at line 197 of file Assertion.h.

◆ ASSERT_NEARLY_EQUALS

#define ASSERT_NEARLY_EQUALS ( expected,
actual )
Value:
assertNearlyEqual(A_FUNCINFO, expected, actual)

Checks that expected and actual are nearly equal.

See also
math::isNearlyEqual()
Deprecated
Use ASSERT_NEARLY_EQUAL() (without the S)

Definition at line 236 of file Assertion.h.

◆ ASSERT_NEARLY_ZERO

#define ASSERT_NEARLY_ZERO ( actual)
Value:
assertNearlyZero(A_FUNCINFO, actual)

Checks that actual is almost equal to zero using the standard epsilon.

See also
math::isNearlyZero()

Definition at line 182 of file Assertion.h.

◆ ASSERT_NEARLY_ZERO_EPSILON

#define ASSERT_NEARLY_ZERO_EPSILON ( actual,
epsilon )
Value:
assertNearlyZeroWithEpsilon(A_FUNCINFO, actual, epsilon)

Checks that actual is almost equal to zero using the specified epsilon epsilon.

See also
math::isNearlyZero()

Definition at line 212 of file Assertion.h.

◆ ASSERT_TRUE

#define ASSERT_TRUE ( condition)
Value:
assertTrue(A_FUNCINFO, condition)

Checks that condition is true.

Definition at line 128 of file Assertion.h.

◆ FAIL

#define FAIL   fail(A_FUNCINFO)

Definition at line 123 of file Assertion.h.

◆ PARALLEL_ASSERT_EQUAL

#define PARALLEL_ASSERT_EQUAL ( expected,
actual,
parallel_mng )
Value:
assertEqual(A_FUNCINFO, expected, actual, parallel_mng)

Checks that expected and actual are equal. The comparison is done via the type's ==() operator.

Definition at line 160 of file Assertion.h.

◆ PARALLEL_ASSERT_FALSE

#define PARALLEL_ASSERT_FALSE ( condition,
parallel_mng )
Value:
assertFalse(A_FUNCINFO, condition, parallel_mng)

Checks that condition is false.

Definition at line 146 of file Assertion.h.

◆ PARALLEL_ASSERT_NEARLY_EQUAL

#define PARALLEL_ASSERT_NEARLY_EQUAL ( expected,
actual,
parallel_mng )
Value:
assertNearlyEqual(A_FUNCINFO, expected, actual, parallel_mng)

Checks that expected and actual are nearly equal.

See also
math::isNearlyEqual()

Definition at line 174 of file Assertion.h.

◆ PARALLEL_ASSERT_NEARLY_EQUAL_EPSILON

#define PARALLEL_ASSERT_NEARLY_EQUAL_EPSILON ( expected,
actual,
epsilon,
parallel_mng )
Value:
assertNearlyEqualWithEpsilon(A_FUNCINFO, expected, actual, epsilon, parallel_mng)

Checks that expected and actual are nearly equal.

See also
math::isNearlyEqualWithEpsilon()

Definition at line 204 of file Assertion.h.

◆ PARALLEL_ASSERT_NEARLY_ZERO

#define PARALLEL_ASSERT_NEARLY_ZERO ( actual,
parallel_mng )
Value:
assertNearlyZero(A_FUNCINFO, actual, parallel_mng)

Checks that actual is almost equal to zero using the standard epsilon.

See also
math::isNearlyZero()

Definition at line 190 of file Assertion.h.

◆ PARALLEL_ASSERT_NEARLY_ZERO_EPSILON

#define PARALLEL_ASSERT_NEARLY_ZERO_EPSILON ( actual,
epsilon,
parallel_mng )
Value:
assertNearlyZeroWithEpsilon(A_FUNCINFO, actual, epsilon, parallel_mng)

Checks that actual is almost equal to zero using the specified epsilon epsilon.

See also
math::isNearlyZero()

Definition at line 220 of file Assertion.h.

◆ PARALLEL_ASSERT_TRUE

#define PARALLEL_ASSERT_TRUE ( condition,
parallel_mng )
Value:
assertTrue(A_FUNCINFO, condition, parallel_mng)

Checks in parallel that condition is true.

Definition at line 134 of file Assertion.h.