tts v2.3.0
The Tiny Test System
 
Loading...
Searching...
No Matches

◆ TTS_EXPECT

#define TTS_EXPECT (   EXPR,
  ... 
)    TTS_EXPECT_ ## __VA_ARGS__ ( EXPR )

Check if a given expression evaluates to true.

Parameters
EXPRExpression to evaluate and compare to true.
...Optional tag. If equals to REQUIRED, this test will stop the program if it fails.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
TTS_CASE( "Check that expectation can be met" )
{
int a = 42, b = 69;
TTS_EXPECT(a < b);
TTS_EXPECT(b > a);
TTS_EXPECT(a != b);
// This test would cause the program to stop and not run the remaining tests
// TTS_EXPECT(a == b, REQUIRED);
TTS_EXPECT(a <= b);
TTS_EXPECT(b >= a);
};
#define TTS_EXPECT(EXPR,...)
Check if a given expression evaluates to true.
Definition: basic.hpp:46
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147