doc test_assert
This commit is contained in:
@@ -2,21 +2,20 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file Test.h
|
* \file Test.h
|
||||||
* \brief File containing unit testing utilities
|
* \brief Contient une assertion utilisable avec les optimisations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def TEST_SUCCESSFUL
|
* \def TEST_SUCCESSFUL
|
||||||
* \brief Used in tests to indicate that a test was successful
|
* \brief Indique que le test a été passé
|
||||||
*/
|
*/
|
||||||
#define TEST_SUCCESSFUL 0
|
#define TEST_SUCCESSFUL 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def TEST_FAILED
|
* \def TEST_FAILED
|
||||||
* \brief Used in tests to indicate that a test failed
|
* \brief Indique que le test a échoué
|
||||||
*/
|
*/
|
||||||
#define TEST_FAILED 1
|
#define TEST_FAILED 1
|
||||||
|
|
||||||
@@ -30,9 +29,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def test_assert
|
* \def test_assert
|
||||||
* \param ... The expression to evaluate
|
* \param ... L'expression à évaluer
|
||||||
* \brief Evaluates the expression and exits the program if not valid.
|
* \brief Evalue une expression et arrête le programme si elle n'est pas valide
|
||||||
* \note It works like a basic assert() but also in release mode
|
* \note Cette macro équivaut à assert() mais fonctionne également avec les optimisations activées
|
||||||
*/
|
*/
|
||||||
#define test_assert(...) \
|
#define test_assert(...) \
|
||||||
if (!static_cast<bool>(__VA_ARGS__)) { \
|
if (!static_cast<bool>(__VA_ARGS__)) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user