Directory: | ./ |
---|---|
File: | tmp_project/PhoenixOptionParser/TESTS/TEST_OPTION_VALUE/main.cpp |
Date: | 2025-03-14 12:18:05 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 23 | 23 | 100.0% |
Branches: | 57 | 57 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
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 "OptionValue.h" | ||
11 | |||
12 | ///Test the option type | ||
13 | 1 | void testOptionValue(){ | |
14 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | OptionValue optValue("Shadoko", OptionType::STRING); |
15 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 16 taken 1 times.
|
1 | phoenix_assert(optValue.getType() == OptionType::STRING); |
16 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optValue.getValue().size() != 0lu); |
17 | 1 | PVecString vecVal; | |
18 |
1/1✓ Branch 1 taken 1 times.
|
1 | OptionValue optVecValue(vecVal, OptionType::STRING); |
19 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optVecValue.getValue().size() == 0lu); |
20 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | OptionValue optDefValue("Shadoko", OptionType::STRING, vecVal); |
21 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optDefValue.getValue().size() != 0lu); |
22 |
1/1✓ Branch 1 taken 1 times.
|
1 | OptionValue optVecDefValue(vecVal, OptionType::STRING, vecVal); |
23 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optVecDefValue.getValue().size() == 0lu); |
24 | |||
25 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | optVecDefValue.setValue("val"); |
26 |
1/1✓ Branch 1 taken 1 times.
|
1 | optVecDefValue.setValue(vecVal); |
27 | |||
28 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | OptionValue optPossibleDefValue("value", OptionType::STRING, vecVal, vecVal); |
29 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optPossibleDefValue.getValue().size() != 0lu); |
30 |
1/1✓ Branch 1 taken 1 times.
|
1 | OptionValue optVecPossibleDefValue(vecVal, OptionType::STRING, vecVal, vecVal); |
31 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optVecPossibleDefValue.getValue().size() == 0lu); |
32 | |||
33 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optVecPossibleDefValue.getDefaultValue().size() == 0lu); |
34 |
5/5✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 17 taken 1 times.
|
1 | phoenix_assert(optVecPossibleDefValue.getPossibleValue().size() == 0lu); |
35 | 1 | } | |
36 | |||
37 | 1 | int main(int argc, char** argv){ | |
38 | 1 | testOptionValue(); | |
39 | 1 | return 0; | |
40 | } | ||
41 | |||
42 | |||
43 |