GCC Code Coverage Report


Directory: ./
File: TESTS/TESTS_REPRESENTATION/TEST_REPRESENTATION/TEST_DAEMONSTATACCUMULATOR/main.cpp
Date: 2026-05-19 15:42:59
Exec Total Coverage
Lines: 23 23 100.0%
Functions: 5 5 100.0%
Branches: 11 16 68.8%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7 #include "assert.h"
8
9 #include "Representation.h"
10
11 using namespace Swarm;
12
13 ///Check the equality between two DaemonStatAccumulator classes
14 /** @param var : variable to be checked
15 * @param reference : reference
16 * @return true on success, false otherwise
17 */
18 2 bool checkDaemonStatAccumulatorEquality(DaemonStatAccumulator & var, DaemonStatAccumulator & reference){
19 2 bool b(true);
20 2 return b;
21 }
22
23 ///Check the equality between two DaemonStatAccumulator classes
24 /** @param var : variable to be checked
25 * @param reference : reference
26 * @return true on success, false otherwise
27 */
28 2 bool checkDaemonStatAccumulatorEqualityConst(const DaemonStatAccumulator & var, const DaemonStatAccumulator & reference){
29 2 bool b(true);
30 2 return b;
31 }
32
33 ///Check copy of class DaemonStatAccumulator
34 1 void checkDaemonStatAccumulatorCopy(){
35
1/1
✓ Branch 0 (2→3) taken 1 times.
1 DaemonStatAccumulator reference;
36 //Let's use the setters
37
1/1
✓ Branch 0 (3→4) taken 1 times.
1 DaemonStatAccumulator varCopy(reference);
38
1/1
✓ Branch 0 (4→5) taken 1 times.
1 DaemonStatAccumulator varEqual;
39
1/1
✓ Branch 0 (5→6) taken 1 times.
1 varEqual = reference;
40
1/2
✗ Branch 0 (7→8) not taken.
✓ Branch 1 (7→9) taken 1 times.
1 assert(checkDaemonStatAccumulatorEquality(varCopy, reference));
41
1/2
✗ Branch 0 (10→11) not taken.
✓ Branch 1 (10→12) taken 1 times.
1 assert(checkDaemonStatAccumulatorEqualityConst(varCopy, reference));
42
1/2
✗ Branch 0 (13→14) not taken.
✓ Branch 1 (13→15) taken 1 times.
1 assert(checkDaemonStatAccumulatorEquality(varEqual, reference));
43
1/2
✗ Branch 0 (16→17) not taken.
✓ Branch 1 (16→18) taken 1 times.
1 assert(checkDaemonStatAccumulatorEqualityConst(varEqual, reference));
44 1 }
45
46 ///Check TypeStream of class DaemonStatAccumulator
47 1 void checkDaemonStatAccumulatorTypeStream(){
48
3/4
✓ Branch 0 (2→3) taken 1 times.
✓ Branch 2 (3→4) taken 1 times.
✗ Branch 4 (4→5) not taken.
✓ Branch 5 (4→6) taken 1 times.
1 assert(phoenix_getTypeToStr<DaemonStatAccumulator>() == "DaemonStatAccumulator");
49 1 }
50
51 1 int main(int argc, char ** argv){
52 1 checkDaemonStatAccumulatorCopy();
53 1 checkDaemonStatAccumulatorTypeStream();
54 1 return 0;
55 }
56