Valued Assertion Macros
Contents
- cmc_assert
- cmc_assert_equals
- cmc_assert_not_equals
- cmc_assert_greater
- cmc_assert_greater_equals
- cmc_assert_lesser
- cmc_assert_lesser_equals
- cmc_assert_in_range
- cmc_assert_not_in_range
cmc_assert
Asserts that an expression
evaluates to true
.
#define cmc_assert(expression)
Parameters
expression
- An expression that needs to be evaluated to true.
cmc_assert_equals
Asserts that a value equals another expected value.
#define cmc_assert_equals(dtype, expected, actual)
Parameters
dtype
- One of the possible data types listed hereexpected
- The expected value for this assertionactual
- A variant that is checked against the expected value
cmc_assert_not_equals
Asserts that a value does not equal another.
#define cmc_assert_not_equals(dtype, not_expected, actual)
Parameters
dtype
- One of the possible data types listed herenot_expected
- The value that is not expected for this assertionactual
- A variant that is checked against the not expected value
cmc_assert_greater
Asserts that a value is above a certain lower boundary.
#define cmc_assert_greater(dtype, boundary, actual)
dtype
- One of the possible data types listed hereboundary
- The expected lowest possible value (excluded)actual
- A variant that is checked against the boundary value
cmc_assert_greater_equals
Asserts that a value is above a certain lower boundary or equal to it.
#define cmc_assert_greater_equals(dtype, boundary, actual)
dtype
- One of the possible data types listed hereboundary
- The expected lowest possible value (included)actual
- A variant that is checked against the boundary value
cmc_assert_lesser
Asserts that a value is below a certain upper boundary.
#define cmc_assert_lesser(dtype, boundary, actual)
dtype
- One of the possible data types listed hereboundary
- The expected highest possible value (excluded)actual
- A variant that is checked against the boundary value
cmc_assert_lesser_equals
Asserts that a value is below a certain upper boundary or equal to it.
#define cmc_assert_lesser_equals(dtype, boundary, actual)
dtype
- One of the possible data types listed hereboundary
- The expected highest possible value (excluded)actual
- A variant that is checked against the boundary value
cmc_assert_in_range
Asserts that a value is within a certain range. Range is inclusive on both ends.
#define cmc_assert_in_range(dtype, lower_bound, upper_bound, actual)
dtype
- One of the possible data types listed herelower_bound
- Smallest value of the expected rangeupper_bound
- Highest value of the expected rangeactual
- A variant that is checked against lower and upper boundaries value
cmc_assert_not_in_range
Asserts that a value is not within a certain range. Range is inclusive on both ends.
#define cmc_assert_not_in_range(dtype, lower_bound, upper_bound, actual)
dtype
- One of the possible data types listed herelower_bound
- Smallest value of the not expected rangeupper_bound
- Highest value of the not expected rangeactual
- A variant that is checked against lower and upper boundaries value