GCC Code Coverage Report


Directory: ./
File: TESTS/TEST_PDEBUG_VECTOR/main.cpp
Date: 2025-11-27 16:27:07
Exec Total Coverage
Lines: 36 36 100.0%
Functions: 3 3 100.0%
Branches: 38 38 100.0%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7 #include <iostream>
8 #include "PDebugVector.h"
9
10 ///Basis test to use the PDebugVector function
11 /** @return true on success, false otherwise
12 */
13 1 bool testDebugVector(){
14
1/1
✓ Branch 0 (2→3) taken 1 times.
1 PDebugVector<int> vecInt;
15
2/2
✓ Branch 0 (6→4) taken 100 times.
✓ Branch 1 (6→7) taken 1 times.
101 for(long unsigned int i(0lu); i < 100lu; ++i){
16
1/1
✓ Branch 0 (4→5) taken 100 times.
100 vecInt.push_back(i);
17 }
18 1 bool b(true);
19 1 b &= vecInt.size() == 100lu;
20
4/4
✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
✓ Branch 4 (11→12) taken 1 times.
✓ Branch 6 (12→13) taken 1 times.
1 std::cerr << "testDebugVector : vecInt with " << vecInt.size() << " elements" << std::endl;
21
22
1/1
✓ Branch 0 (13→14) taken 1 times.
1 PDebugVector<int> vecInt2(vecInt);
23 1 b &= vecInt2.size() == 100lu;
24
4/4
✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (17→18) taken 1 times.
✓ Branch 4 (18→19) taken 1 times.
✓ Branch 6 (19→20) taken 1 times.
1 std::cerr << "testDebugVector : vecInt2 with " << vecInt2.size() << " elements" << std::endl;
25
26
1/1
✓ Branch 0 (20→21) taken 1 times.
1 PDebugVector<int> vecInt3;
27
1/1
✓ Branch 0 (21→22) taken 1 times.
1 vecInt3 = vecInt;
28 1 b &= vecInt3.size() == 100lu;
29
4/4
✓ Branch 0 (23→24) taken 1 times.
✓ Branch 2 (25→26) taken 1 times.
✓ Branch 4 (26→27) taken 1 times.
✓ Branch 6 (27→28) taken 1 times.
1 std::cerr << "testDebugVector : vecInt3 with " << vecInt3.size() << " elements" << std::endl;
30
31 1 return b;
32 1 }
33
34 ///Basis test to use the PDebugVector function
35 /** @return true on success, false otherwise
36 */
37 1 bool testDebugVectorFlux(){
38
1/1
✓ Branch 0 (2→3) taken 1 times.
1 PDebugVector<int> vecInt;
39
2/2
✓ Branch 0 (6→4) taken 100 times.
✓ Branch 1 (6→7) taken 1 times.
101 for(long unsigned int i(0lu); i < 100lu; ++i){
40
1/1
✓ Branch 0 (4→5) taken 100 times.
100 vecInt << i;
41 }
42 1 bool b(true);
43 1 b &= vecInt.size() == 100lu;
44
4/4
✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
✓ Branch 4 (11→12) taken 1 times.
✓ Branch 6 (12→13) taken 1 times.
1 std::cerr << "testDebugVectorFlux : vecInt with " << vecInt.size() << " elements" << std::endl;
45
46
1/1
✓ Branch 0 (13→14) taken 1 times.
1 PDebugVector<int> vecInt2(vecInt);
47 1 b &= vecInt2.size() == 100lu;
48
4/4
✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (17→18) taken 1 times.
✓ Branch 4 (18→19) taken 1 times.
✓ Branch 6 (19→20) taken 1 times.
1 std::cerr << "testDebugVectorFlux : vecInt2 with " << vecInt2.size() << " elements" << std::endl;
49
50
1/1
✓ Branch 0 (20→21) taken 1 times.
1 PDebugVector<int> vecInt3;
51
1/1
✓ Branch 0 (21→22) taken 1 times.
1 vecInt3 = vecInt;
52 1 b &= vecInt3.size() == 100lu;
53
4/4
✓ Branch 0 (23→24) taken 1 times.
✓ Branch 2 (25→26) taken 1 times.
✓ Branch 4 (26→27) taken 1 times.
✓ Branch 6 (27→28) taken 1 times.
1 std::cerr << "testDebugVectorFlux : vecInt3 with " << vecInt3.size() << " elements" << std::endl;
54
55 1 return b;
56 1 }
57
58 1 int main(int argc, char** argv){
59 1 bool b(testDebugVector());
60 1 b &= testDebugVectorFlux();
61 1 return b - 1;
62 }
63
64
65