| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | |||
| 8 | #include "check_yml_config_node.h" | ||
| 9 | |||
| 10 | ///Check the value of a ConfigNode | ||
| 11 | /** @param mapKey : ConfigNode to be checked | ||
| 12 | * @param expectedValue : expected value | ||
| 13 | * @return true if the value matches the expectedValue, false otherwise | ||
| 14 | */ | ||
| 15 | 17 | bool checkKeyMapValue(const ConfigNode * mapKey, const std::string & expectedValue){ | |
| 16 |
2/2✓ Branch 0 (2→3) taken 1 times.
✓ Branch 1 (2→9) taken 16 times.
|
17 | if(mapKey == NULL){ |
| 17 | 1 | std::cout << "checkKeyMapValue : map NULL for expectedValue = '"<<expectedValue<<"'" << std::endl; | |
| 18 | 1 | return expectedValue == ""; | |
| 19 | } | ||
| 20 | // std::cout << "checkKeyMapValue : map '"<<mapKey->getKey()<<"' => '"<<mapKey->getValue()<<"', expectedValue = '"<<expectedValue<<"'" << std::endl; | ||
| 21 |
2/2✓ Branch 0 (12→13) taken 16 times.
✓ Branch 2 (13→14) taken 16 times.
|
32 | bool b(phoenix_check("checkKeyMapValue", mapKey->getValue(), expectedValue)); |
| 22 | // std::cout << "checkKeyMapValue : b = " << b << std::endl; | ||
| 23 | 16 | return b; | |
| 24 | } | ||
| 25 | |||
| 26 | ///Check the value of a ConfigNode | ||
| 27 | /** @param mapKey : ConfigNode to be checked | ||
| 28 | * @param expectedValue : expected value | ||
| 29 | * @return true if the value matches the expectedValue, false otherwise | ||
| 30 | */ | ||
| 31 | 12 | bool checkKeyMapVecValue(const ConfigNode * mapKey, const std::vector<std::string> & vecExpectedValue){ | |
| 32 |
2/2✓ Branch 0 (2→3) taken 1 times.
✓ Branch 1 (2→7) taken 11 times.
|
12 | if(mapKey == NULL){ |
| 33 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | std::cout << "checkKeyMapVecValue : map NULL for vecExpectedValue = " << std::endl; |
| 34 | // phoenix_print(vecExpectedValue); | ||
| 35 | 1 | return vecExpectedValue.size() == 0lu; | |
| 36 | } | ||
| 37 | // std::cout << "checkKeyMapVecValue : map '"<<mapKey->getKey()<<"' => '"<<mapKey->getValue()<<"', vecExpectedValue = " << std::endl; | ||
| 38 | // phoenix_print(vecExpectedValue); | ||
| 39 | 11 | bool b(true); | |
| 40 |
1/1✓ Branch 0 (7→8) taken 11 times.
|
11 | const VecConfigNode & vecValue = mapKey->getVecChild(); |
| 41 | 11 | b &= vecValue.size() == vecExpectedValue.size(); | |
| 42 | // std::cout << "checkKeyMapVecValue : vecValue.size() = " << vecValue.size() << ", vecExpectedValue.size() = "<< vecExpectedValue.size() << ", isOk = " << b << std::endl; | ||
| 43 | 11 | VecConfigNode::const_iterator it(vecValue.begin()); | |
| 44 | 11 | std::vector<std::string>::const_iterator itRef(vecExpectedValue.begin()); | |
| 45 |
6/8✓ Branch 0 (24→25) taken 48 times.
✗ Branch 1 (24→42) not taken.
✓ Branch 2 (32→33) taken 37 times.
✓ Branch 3 (32→42) taken 11 times.
✓ Branch 4 (40→41) taken 37 times.
✗ Branch 5 (40→42) not taken.
✓ Branch 6 (43→13) taken 37 times.
✓ Branch 7 (43→44) taken 11 times.
|
133 | while(b && it != vecValue.end() && itRef != vecExpectedValue.end()){ |
| 46 |
1/1✓ Branch 0 (17→18) taken 37 times.
|
74 | b &= (*it)->getValue() == *itRef; |
| 47 | // std::cout << "\tvalue = '" << it->getValue() << "', reference = '"<< *itRef << "', isOk = " << b << std::endl; | ||
| 48 | ++it; | ||
| 49 | ++itRef; | ||
| 50 | } | ||
| 51 | // std::cout << "checkKeyMapVecValue : b = " << b << std::endl; | ||
| 52 | 11 | return b; | |
| 53 | } | ||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 |