#include <iostream>
#include "phoenix_assert.h"
#include "phoenix_check.h"
#include "convertToString.h"
Go to the source code of this file.
◆ checkResultConvertToString()
template<typename T >
bool checkResultConvertToString |
( |
const std::string & |
testName, |
|
|
T |
value, |
|
|
const std::string & |
strReference |
|
) |
| |
Check string expression.
- Parameters
-
testName | : name of the test |
value | : value to be tested |
strReference | : reference string |
- Returns
- true is both strings are equal, false otherwise
Definition at line 21 of file main.cpp.
std::string valueToString(const T &val)
Convert a type into a string.
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.
References phoenix_check(), and valueToString().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ testConvertToString()
void testConvertToString |
( |
| ) |
|
Test convert to string.
Definition at line 27 of file main.cpp.
28 phoenix_assert(checkResultConvertToString<int>(
"Test value int", 1,
"1"));
29 phoenix_assert(checkResultConvertToString<unsigned int>(
"Test value unsigned int", 1,
"1"));
30 phoenix_assert(checkResultConvertToString<long int>(
"Test value long int", 1,
"1"));
31 phoenix_assert(checkResultConvertToString<long unsigned int>(
"Test value long unsigned int", 1,
"1"));
32 phoenix_assert(checkResultConvertToString<double>(
"Test value double", 1.0,
"1"));
33 phoenix_assert(checkResultConvertToString<double>(
"Test value double", 1.5,
"1.5"));
34 phoenix_assert(checkResultConvertToString<float>(
"Test value float", 1.0f,
"1"));
35 phoenix_assert(checkResultConvertToString<float>(
"Test value float", 1.5f,
"1.5"));
36 phoenix_assert(checkResultConvertToString<std::string>(
"Test value string",
"1.0f",
"1.0f"));
Path of a directory or a file.
PPath stringToValue< PPath >(const std::string &str)
Convert a string to value (specialisation for PPath)
PString stringToValue< PString >(const std::string &str)
Convert a string to value (specialisation for PString)
std::string valueToString< PString >(const PString &val)
Convert a value to string (specialisation for PString)
std::string valueToString< PPath >(const PPath &val)
Convert a value to string (specialisation for PPath)
bool stringToValue< bool >(const std::string &str)
Convert a string to value (specialisation for bool)
#define phoenix_assert(isOk)
References phoenix_assert, stringToValue< bool >(), stringToValue< PPath >(), stringToValue< PString >(), valueToString(), valueToString< PPath >(), and valueToString< PString >().
Referenced by main().