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 "ArgParser.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void testArgParser ()
 Test the ArgParser. More...
 
bool testArgParserArg (int argc, char **argv)
 Test the ArgParser. More...
 
bool testConstGetCurrentOption (const ArgParser &arg)
 Test the ArgParser. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file main.cpp.

56  {
57  testArgParser();
58  phoenix_assert(testArgParserArg(argc, argv));
60  return 0;
61 }

References phoenix_assert, testArgParser(), and testArgParserArg().

+ Here is the call graph for this function:

◆ testArgParser()

void testArgParser ( )

Test the ArgParser.

Definition at line 13 of file main.cpp.

13  {
14  ArgParser arg;
15  ArgParser arg2(arg);
16  ArgParser arg3;
17  arg3 = arg;
18 
19  arg.print();
20  phoenix_assert(arg.getNbArgument() == 0lu);
21  arg.rewind();
22 }

References ArgParser::getNbArgument(), phoenix_assert, ArgParser::print(), and ArgParser::rewind().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testArgParserArg()

bool testArgParserArg ( int  argc,
char **  argv 
)

Test the ArgParser.

Returns
true on success, false otherwise

Definition at line 35 of file main.cpp.

35  {
36  bool b(true);
37 
38  ArgParser arg(argc, argv);
39  ArgParser arg2(arg);
40  ArgParser arg3;
41  arg3 = arg;
42 
43  arg.print();
44  b &= arg.getNbArgument() != 0lu;
45 
46  if(arg.getNbArgument() != 0lu){
47  arg.print();
48  b &= arg.getCurrentOption() != "";
49  b &= testConstGetCurrentOption(arg);
50  }
51 
52  arg.rewind();
53  return b;
54 }

References ArgParser::getCurrentOption(), ArgParser::getNbArgument(), ArgParser::print(), ArgParser::rewind(), and testConstGetCurrentOption().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testConstGetCurrentOption()

bool testConstGetCurrentOption ( const ArgParser arg)

Test the ArgParser.

Parameters
arg: constant ArgParser to be tested
Returns
true on success, false otherwise

Definition at line 28 of file main.cpp.

28  {
29  return arg.getCurrentOption() != "";
30 }

References ArgParser::getCurrentOption().

Referenced by testArgParserArg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
testArgParserArg
bool testArgParserArg(int argc, char **argv)
Test the ArgParser.
Definition: main.cpp:35
testArgParser
void testArgParser()
Test the ArgParser.
Definition: main.cpp:13
ArgParser::getCurrentOption
const std::string & getCurrentOption() const
Get the current option.
Definition: ArgParser.cpp:93
ArgParser::print
void print() const
Print all the input option.
Definition: ArgParser.cpp:67
ArgParser::getNbArgument
size_t getNbArgument() const
Get the number of arguments passed to the program.
Definition: ArgParser.cpp:107
phoenix_assert
#define phoenix_assert(isOk)
Definition: phoenix_assert.h:19
ArgParser::rewind
void rewind()
Go bask to the first argument.
Definition: ArgParser.cpp:74
testConstGetCurrentOption
bool testConstGetCurrentOption(const ArgParser &arg)
Test the ArgParser.
Definition: main.cpp:28
ArgParser
Parse the list of arguments passed to a program.
Definition: ArgParser.h:16