GCC Code Coverage Report


Directory: ./
File: tmp_project/PhoenixOptionParser/src/OptionMode_impl.h
Date: 2025-03-14 12:18:05
Exec Total Coverage
Lines: 8 9 88.9%
Branches: 12 22 54.5%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7 #ifndef __POPTIONMODE_IMPL_H__
8 #define __POPTIONMODE_IMPL_H__
9
10 #include "OptionMode.h"
11
12 ///Get the value of the option
13 /** @param[out] value : value of the option
14 * @param optionName : name of option to get the option
15 * @return true on success, false otherwise
16 */
17 template<typename T>
18 48 bool OptionMode::getValue(T & value, const PString & optionName) const{
19
1/2
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
48 Option option;
20
2/4
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 36 times.
48 if(!getOption(option, optionName)){return false;}
21
6/10
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 28 times.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 36 times.
48 if(!option.isParsed() && option.isRequired()){
22 return false;
23 }
24
1/2
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
48 OptionValue & optionValue = option.getValue();
25
2/4
✓ Branch 1 taken 36 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 36 times.
✗ Branch 5 not taken.
48 optionValue.getValue(value, option.isParsed());
26 48 return true;
27 48 }
28
29
30 #endif
31
32