GCC Code Coverage Report


Directory: ./
File: TESTS/TEST_DAEMONS/TEST_DAEMON_FUNCTION/main.cpp
Date: 2026-01-15 15:35:36
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 3 3 100.0%
Branches: 30 34 88.2%

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 <iostream>
9 #include "phoenix_assert.h"
10 #include "phoenix_check.h"
11 #include "phoenix_createData.h"
12 #include "FunctionCall.h"
13
14 ///Super interesting function which will called in the test
15 /** @param val : integer value
16 * @return operation on the value
17 */
18 1 int superInterestingFunction(int val){
19 1 return val + 2;
20 }
21
22 ///Test the function call
23 1 void testFunction(){
24
4/7
✓ Branch 0 (2→3) taken 1 times.
✓ Branch 2 (3→4) taken 1 times.
✓ Branch 4 (4→5) taken 1 times.
✗ Branch 6 (6→7) not taken.
✓ Branch 7 (6→8) taken 1 times.
✗ Branch 8 (83→84) not taken.
✗ Branch 9 (83→85) not taken.
1 AbstractFunction* call = new FunctionCall(superInterestingFunction, "superInterestingFunction");
25
6/6
✓ Branch 0 (10→11) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
✓ Branch 4 (16→17) taken 1 times.
✓ Branch 6 (17→18) taken 1 times.
✓ Branch 8 (18→19) taken 1 times.
✓ Branch 10 (19→20) taken 1 times.
5 phoenix_assert(call->getName() == "superInterestingFunction");
26
2/2
✓ Branch 0 (26→27) taken 1 times.
✓ Branch 2 (27→28) taken 1 times.
1 call->setName("multiply");
27
6/6
✓ Branch 0 (31→32) taken 1 times.
✓ Branch 2 (34→35) taken 1 times.
✓ Branch 4 (37→38) taken 1 times.
✓ Branch 6 (38→39) taken 1 times.
✓ Branch 8 (39→40) taken 1 times.
✓ Branch 10 (40→41) taken 1 times.
5 phoenix_assert(call->getName() == "multiply");
28
29 1 int value(42);
30
1/1
✓ Branch 0 (47→48) taken 1 times.
1 Data param(phoenix_createData(value));
31
32
1/1
✓ Branch 0 (48→49) taken 1 times.
1 PLog log;
33
1/1
✓ Branch 0 (49→50) taken 1 times.
1 Data result;
34
1/1
✓ Branch 0 (50→51) taken 1 times.
1 call->call(log, result, param);
35
36
1/1
✓ Branch 0 (51→52) taken 1 times.
1 int resValue = phoenix_getValueFromData<int>(result);
37
6/6
✓ Branch 0 (54→55) taken 1 times.
✓ Branch 2 (57→58) taken 1 times.
✓ Branch 4 (60→61) taken 1 times.
✓ Branch 6 (63→64) taken 1 times.
✓ Branch 8 (64→65) taken 1 times.
✓ Branch 10 (65→66) taken 1 times.
7 phoenix_assert(phoenix_check("resValue", resValue, 44));
38
39
1/2
✓ Branch 0 (74→75) taken 1 times.
✗ Branch 1 (74→76) not taken.
1 delete call;
40 1 }
41
42 1 int main(int argc, char** argv){
43 1 testFunction();
44 1 return 0;
45 }
46
47
48