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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void printValueOfOpt (const OptionValue &opt)
 Print value of OptionValue. More...
 
bool testOptionValue ()
 Test the option type. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 54 of file main.cpp.

54  {
56  return 0;
57 }

References phoenix_assert, and testOptionValue().

+ Here is the call graph for this function:

◆ printValueOfOpt()

void printValueOfOpt ( const OptionValue opt)

Print value of OptionValue.

Parameters
opt: OptionValue to be printed

Definition at line 16 of file main.cpp.

16  {
17  phoenix_print(opt.getValue());
18 
21 }

References OptionValue::getDefaultValue(), OptionValue::getPossibleValue(), OptionValue::getValue(), and phoenix_print().

+ Here is the call graph for this function:

◆ testOptionValue()

bool testOptionValue ( )

Test the option type.

Returns
true on success, false otherwise

Definition at line 26 of file main.cpp.

26  {
27  bool b(true);
28 
29  OptionValue optValue("Shadoko", OptionType::STRING);
30  phoenix_print(optValue.getValue());
31  printValueOfOpt(optValue);
32  VecValue vecVal;
33  OptionValue optVecValue(vecVal, OptionType::STRING);
34  phoenix_print(optVecValue.getValue());
35  OptionValue optDefValue("Shadoko", OptionType::STRING, vecVal);
36  phoenix_print(optDefValue.getValue());
37  OptionValue optVecDefValue(vecVal, OptionType::STRING, vecVal);
38  phoenix_print(optVecDefValue.getValue());
39 
40  optVecDefValue.setValue("val");
41  optVecDefValue.setValue(vecVal);
42 
43  OptionValue optPossibleDefValue("value", OptionType::STRING, vecVal, vecVal);
44  phoenix_print(optPossibleDefValue.getValue());
45  OptionValue optVecPossibleDefValue(vecVal, OptionType::STRING, vecVal, vecVal);
46  phoenix_print(optVecPossibleDefValue.getValue());
47 
48  phoenix_print(optVecPossibleDefValue.getDefaultValue());
49  phoenix_print(optVecPossibleDefValue.getPossibleValue());
50  phoenix_functionOk("testOptionValue", b);
51  return b;
52 }

References OptionValue::getDefaultValue(), OptionValue::getPossibleValue(), OptionValue::getValue(), phoenix_functionOk(), phoenix_print(), printValueOfOpt(), OptionValue::setValue(), and OptionType::STRING.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
testOptionValue
bool testOptionValue()
Test the option type.
Definition: main.cpp:26
phoenix_print
void phoenix_print(const T &data, const std::string &suffix="", const std::string &prefix="")
Print data.
Definition: print_string_impl.h:18
printValueOfOpt
void printValueOfOpt(Option &opt)
Print value of Option.
Definition: main.cpp:29
OptionType::STRING
@ STRING
Definition: OptionType.h:25
phoenix_functionOk
void phoenix_functionOk(const std::string &functionName, bool b)
Print the check function return.
Definition: phoenix_isOk.cpp:23
OptionValue::getPossibleValue
const VecValue & getPossibleValue() const
Get the possible values of the OptionValue.
Definition: OptionValue.cpp:161
OptionValue::getValue
const VecValue & getValue() const
Get the vector of values.
Definition: OptionValue.cpp:131
phoenix_assert
#define phoenix_assert(isOk)
Definition: phoenix_assert.h:19
OptionValue
Describe the value of an option passed to a program.
Definition: OptionValue.h:20
OptionValue::getDefaultValue
const VecValue & getDefaultValue() const
Get the default value of the OptionValue.
Definition: OptionValue.cpp:151
VecValue
std::vector< std::string > VecValue
Vector of values.
Definition: OptionValue.h:17