PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
main.cpp
Go to the documentation of this file.
1
2
/***************************************
3
Auteur : Pierre Aubert
4
Mail : pierre.aubert@lapp.in2p3.fr
5
Licence : CeCILL-C
6
****************************************/
7
8
#include "
phoenix_assert.h
"
9
#include "
phoenix_check.h
"
10
#include "
ArgParser.h
"
11
13
void
testArgParser
(){
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
}
23
25
28
bool
testConstGetCurrentOption
(
const
ArgParser
& arg){
29
return
arg.
getCurrentOption
() !=
""
;
30
}
31
33
35
bool
testArgParserArg
(
int
argc,
char
** argv){
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
}
55
56
int
main
(
int
argc,
char
** argv){
57
testArgParser
();
58
phoenix_assert
(
testArgParserArg
(argc, argv));
59
phoenix_assert
(!
testArgParserArg
(0, argv));
60
return
0;
61
}
62
63
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.h
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
phoenix_assert.h
ArgParser::rewind
void rewind()
Go bask to the first argument.
Definition:
ArgParser.cpp:74
main
int main(int argc, char **argv)
Definition:
main.cpp:85
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
phoenix_check.h
tmp_project
OptionParser
TESTS
TEST_ARGPARSER
main.cpp
Generated on Mon Dec 9 2024 15:33:41 for PhoenixMock by
1.8.17