Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
Floating-point assertions

Macros

#define cr_assert_float_eq(Actual, Expected, Epsilon, FormatString, ...)   internal
 
#define cr_expect_float_eq(Actual, Expected, Epsilon, FormatString, ...)   internal
 
#define cr_assert_float_neq(Actual, Unexpected, Epsilon, FormatString, ...)   internal
 
#define cr_expect_float_neq(Actual, Unexpected, Epsilon, FormatString, ...)   internal
 

Detailed Description

Macro Definition Documentation

◆ cr_assert_float_eq

#define cr_assert_float_eq ( Actual,
Expected,
Epsilon,
FormatString,
... )   internal

Passes if Actual is equal to Expected with a tolerance of Epsilon

Passes if Actual is equal to Expected with a tolerance of Epsilon. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Note
Use this to test equality between floats
Parameters
[in]ActualValue to test
[in]ExpectedExpected value
[in]EpsilonTolerance between Actual and Expected
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 460 of file assert.h.

◆ cr_assert_float_neq

#define cr_assert_float_neq ( Actual,
Unexpected,
Epsilon,
FormatString,
... )   internal

Passes if Actual is not equal to Unexpected with a tolerance of Epsilon

Passes if Actual is not equal to Unexpected with a tolerance of Epsilon. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Note
Use this to test inequality between floats
Parameters
[in]ActualValue to test
[in]UnexpectedUnexpected value
[in]EpsilonTolerance between Actual and Expected
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 499 of file assert.h.

◆ cr_expect_float_eq

#define cr_expect_float_eq ( Actual,
Expected,
Epsilon,
FormatString,
... )   internal

Passes if Actual is equal to Expected with a tolerance of Epsilon

Passes if Actual is equal to Expected with a tolerance of Epsilon. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Note
Use this to test equality between floats
Parameters
[in]ActualValue to test
[in]ExpectedExpected value
[in]EpsilonTolerance between Actual and Expected
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 479 of file assert.h.

◆ cr_expect_float_neq

#define cr_expect_float_neq ( Actual,
Unexpected,
Epsilon,
FormatString,
... )   internal

Passes if Actual is not equal to Unexpected with a tolerance of Epsilon

Passes if Actual is not equal to Unexpected with a tolerance of Epsilon. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Note
Use this to test inequality between floats
Parameters
[in]ActualValue to test
[in]UnexpectedUnexpected value
[in]EpsilonTolerance between Actual and Expected
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 518 of file assert.h.