Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
property_assertions.hpp File Reference

Go to the source code of this file.

Macro Definition Documentation

◆ ARENE_PROP_ASSERT

#define ARENE_PROP_ASSERT ( ...)
Value:
do { /* NOLINT(cppcoreguidelines-avoid-do-while) */ \
if (!static_cast<bool>(__VA_ARGS__) && !::arene::base::testing::detail::property_context().has_value()) { \
::arene::base::testing::detail::property_context().emplace(::arene::base::testing::property_error{ \
{__FILE__, __LINE__}, \
{#__VA_ARGS__} \
}); \
return; \
} \
} while (false)
error result of evaluating a property assertion
Definition property_error.hpp:17
@ failure
Definition property_error.hpp:18

Macro to assert that a property is true.

Parameters
exprproperty to check If the property encoded in expr is false, returns a property_outcome with status == failure.

◆ ARENE_PROP_ASSERT_FALSE

#define ARENE_PROP_ASSERT_FALSE ( ...)
Value:
ARENE_PROP_ASSERT(!(__VA_ARGS__))
#define ARENE_PROP_ASSERT(...)
Macro to assert that a property is true.
Definition property_assertions.hpp:13

Macro to assert that a property is false.

Parameters
exprproperty to check If the property encoded in expr is true, returns a property_outcome with status == failure.

◆ ARENE_PROP_ASSERT_TRUE

#define ARENE_PROP_ASSERT_TRUE ( ...)
Value:
ARENE_PROP_ASSERT(__VA_ARGS__)

Macro to assert that a property is true.

Parameters
exprproperty to check If the property encoded in expr is false, returns a property_outcome with status == failure.

◆ ARENE_PROP_PRE

#define ARENE_PROP_PRE ( ...)
Value:
do { /* NOLINT(cppcoreguidelines-avoid-do-while) */ \
if (!static_cast<bool>(__VA_ARGS__) && !::arene::base::testing::detail::property_context().has_value()) { \
::arene::base::testing::detail::property_context().emplace(::arene::base::testing::property_error{ \
{__FILE__, __LINE__}, \
{#__VA_ARGS__} \
}); \
return; \
} \
} while (false)
@ discard
Definition property_error.hpp:18

Macro to discard a specific run.

Parameters
exprproperty to check If expr is false, returns a property_outcome with status == discard.