A boolean assumption/assertion evaluates conditions that result in either true or false values. These types of assertions are fundamental for testing logical conditions within the code, such as whether certain flags or states are set correctly. They are commonly used to verify that specific boolean outcomes occur, ensuring the integrity of decision-making branches in the software and preventing unexpected states from slipping through the testing process.
Code reference for C, C++, or Python APIs for a respective Fossil Logic Project.
C, C++ REFERENCE #
/**
* @brief Assumes that the given boolean expression is true.
*
* @param actual The boolean expression to be evaluated.
*/
#define ASSUME_ITS_TRUE(actual) \
FOSSIL_TEST_ASSUME((actual), "Expected " #actual " to be true")
/**
* @brief Assumes that the given boolean expression is false.
*
* @param actual The boolean expression to be evaluated.
*/
#define ASSUME_ITS_FALSE(actual) \
FOSSIL_TEST_ASSUME(!(actual), "Expected " #actual " to be false")
/**
* @brief Assumes that the given boolean expression is not true.
*
* @param actual The boolean expression to be evaluated.
*/
#define ASSUME_NOT_TRUE(actual) \
FOSSIL_TEST_ASSUME(!(actual), "Expected " #actual " to not be true")
/**
* @brief Assumes that the given boolean expression is not false.
*
* @param actual The boolean expression to be evaluated.
*/
#define ASSUME_NOT_FALSE(actual) \
FOSSIL_TEST_ASSUME((actual), "Expected " #actual " to not be false")PYTHON REFERENCE #
# TODO: add code here