1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
#include <iostream> |
8 |
|
|
#include "phoenix_isOk.h" |
9 |
|
|
|
10 |
|
|
///Print OK or FAIL depending on the given boolean |
11 |
|
|
/** @param b : boolean to be checked |
12 |
|
|
* @return OK on true, FAIL on false |
13 |
|
|
*/ |
14 |
|
52 |
std::string phoenix_isOk(bool b){ |
15 |
|
52 |
const char* res[] = {"\033[31mFAIL\033[0m", "\033[32mOK\033[0m"}; |
16 |
✓ |
52 |
return std::string(res[b]); |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
///Print the check function return |
20 |
|
|
/** @param functionName : name of the function |
21 |
|
|
* @param b : boolean to be checked |
22 |
|
|
*/ |
23 |
|
6 |
void phoenix_functionOk(const std::string & functionName, bool b){ |
24 |
✓✓ |
6 |
std::cout << functionName << " : " << phoenix_isOk(b) << std::endl; |
25 |
|
6 |
} |
26 |
|
|
|