Directory: | ./ |
---|---|
File: | tmp_project/PhoenixYml/TESTS/TEST_PARSER_YML/main_list_map.cpp |
Date: | 2025-03-27 14:50:11 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 21 | 21 | 100.0% |
Branches: | 31 | 37 | 83.8% |
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 "parser_yml.h" | ||
10 | |||
11 | ///Check the YML parser | ||
12 | /** @param ymlFile : file to be used for the test | ||
13 | */ | ||
14 | 2 | void checkParserYml(const PPath & ymlFile){ | |
15 |
1/1✓ Branch 1 taken 2 times.
|
2 | DicoValue dico; |
16 |
5/5✓ Branch 2 taken 2 times.
✓ Branch 6 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
|
2 | phoenix_assert(parser_yml(dico, ymlFile)); |
17 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | std::cout << "checkParserYml("<<ymlFile<<") : output DicoValue :" << std::endl; |
18 |
1/1✓ Branch 1 taken 2 times.
|
2 | dico.print(); |
19 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | const DicoValue * mapImageDef = dico.getMap("images_definition"); |
20 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | assert(mapImageDef != NULL); |
21 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if(mapImageDef != NULL){ |
22 |
1/1✓ Branch 1 taken 2 times.
|
2 | const VecDicoValue & vecImage = mapImageDef->getVecChild(); |
23 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
|
2 | assert(vecImage.size() == 4lu); |
24 |
2/2✓ Branch 4 taken 8 times.
✓ Branch 5 taken 2 times.
|
10 | for(VecDicoValue::const_iterator it(vecImage.begin()); it != vecImage.end(); ++it){ |
25 |
2/2✓ Branch 2 taken 8 times.
✓ Branch 5 taken 8 times.
|
8 | const DicoValue * dicoImage = it->getMap("image"); |
26 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
8 | assert(dicoImage != NULL); |
27 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | const DicoValue * dicoName = dicoImage->getMap("name"); |
28 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
8 | assert(dicoName != NULL); |
29 |
2/3✓ Branch 1 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
|
8 | assert(dicoName->getValue() == "value"); |
30 | } | ||
31 | } | ||
32 | 2 | } | |
33 | |||
34 | 1 | int main(int argc, char** argv){ | |
35 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
|
1 | checkParserYml(PPath(LIST_MAP_YML_CONFIG)); |
36 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
|
1 | checkParserYml(PPath(LIST_MAP_YML_CONFIG_NO_INDENT)); |
37 | 1 | return 0; | |
38 | } | ||
39 | |||
40 | |||
41 |