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 "
print_string.h
"
11
#include "
OptionValue.h
"
12
14
16
void
printValueOfOpt
(
const
OptionValue
& opt){
17
phoenix_print
(opt.
getValue
());
18
19
phoenix_print
(opt.
getDefaultValue
());
20
phoenix_print
(opt.
getPossibleValue
());
21
}
22
24
26
bool
testOptionValue
(){
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
}
53
54
int
main
(
int
argc,
char
** argv){
55
phoenix_assert
(
testOptionValue
());
56
return
0;
57
}
58
59
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.h
OptionValue::getPossibleValue
const VecValue & getPossibleValue() const
Get the possible values of the OptionValue.
Definition:
OptionValue.cpp:161
print_string.h
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::setValue
void setValue(const std::string &value)
Set the value of the OptionValue.
Definition:
OptionValue.cpp:112
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
phoenix_assert.h
main
int main(int argc, char **argv)
Definition:
main.cpp:85
phoenix_check.h
tmp_project
OptionParser
TESTS
TEST_OPTION_VALUE
main.cpp
Generated on Mon Dec 9 2024 15:33:41 for PhoenixMock by
1.8.17