PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
main.cpp File Reference
#include <iostream>
#include "phoenix_assert.h"
#include "phoenix_check.h"
#include "convertToString.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

template<typename T >
bool checkResultConvertToString (const std::string &testName, T value, const std::string &strReference)
 Check string expression. More...
 
int main (int argc, char **argv)
 
void testConvertToString ()
 Test convert to string. More...
 

Function Documentation

◆ checkResultConvertToString()

template<typename T >
bool checkResultConvertToString ( const std::string &  testName,
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.

21  {
22  std::string convertedValue(convertToString(value));
23  return phoenix_check(testName, convertedValue, strReference);
24 }

References convertToString(), and phoenix_check().

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 42 of file main.cpp.

42  {
44  return 0;
45 }

References testConvertToString().

+ Here is the call graph for this function:

◆ testConvertToString()

void testConvertToString ( )

Test convert to string.

Definition at line 27 of file main.cpp.

27  {
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"));
37  phoenix_assert(stringToValue<int>("314") == 314);
38  phoenix_assert(stringToValue<std::string>("314") == "314");
39 }

References phoenix_assert.

Referenced by main().

+ Here is the caller graph for this function:
convertToString
std::string convertToString(const T &val)
Convert a type into a string.
Definition: convertToString_impl.h:17
phoenix_check
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.
Definition: phoenix_check.cpp:17
testConvertToString
void testConvertToString()
Test convert to string.
Definition: main.cpp:27
phoenix_assert
#define phoenix_assert(isOk)
Definition: phoenix_assert.h:19