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

◆ TTS_EXPR_IS

#define TTS_EXPR_IS (   EXPR,
  TYPE,
  ... 
)    TTS_EXPR_IS_ ## __VA_ARGS__ (EXPR, TYPE)

Checks if an Expression evaluates to a value of a given Type.

Parameters
EXPRExpression to evaluate.
TYPEExpected type.
...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 expression types can be tested for equality" )
{
double d;
TTS_EXPR_IS( &d + 5 , double* );
TTS_EXPR_IS( std::move(d) , double&& );
TTS_EXPR_IS( std::swap(d,d), void );
};
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147
#define TTS_EXPR_IS(EXPR, TYPE,...)
Checks if an Expression evaluates to a value of a given Type.
Definition: types.hpp:87