GCC Code Coverage Report


Directory: ./
File: TESTS/TEST_HARDWARE/main.cpp
Date: 2025-08-06 14:32:39
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 2 2 100.0%
Branches: 19 19 100.0%

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_hardware_characteristics.h"
10
11 ///Test the hardware info
12 /** @return true on success, false otherwise
13 */
14 1 bool testStringhardware(){
15
1/1
✓ Branch 0 (2→3) taken 1 times.
1 float ramUsed = phoenix_hardware_usedRAM();
16
1/1
✓ Branch 0 (3→4) taken 1 times.
1 float totalRam = phoenix_hardware_totalRAM();
17
1/1
✓ Branch 0 (4→5) taken 1 times.
1 size_t nbCore = phoenix_hardware_nbCore();
18
7/7
✓ Branch 0 (5→6) taken 1 times.
✓ Branch 2 (6→7) taken 1 times.
✓ Branch 4 (7→8) taken 1 times.
✓ Branch 6 (8→9) taken 1 times.
✓ Branch 8 (9→10) taken 1 times.
✓ Branch 10 (10→11) taken 1 times.
✓ Branch 12 (11→12) taken 1 times.
1 std::cout << "testStringhardware : ramUsed = " << ramUsed << ", totalRam = " << totalRam << ", nbCore = " << nbCore << std::endl;
19
20
2/2
✓ Branch 0 (14→15) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
3 std::string hostName(""), ipAddress("");
21
1/1
✓ Branch 0 (20→21) taken 1 times.
1 phoenix_hardware_hostNameIp(hostName, ipAddress);
22
6/6
✓ Branch 0 (21→22) taken 1 times.
✓ Branch 2 (22→23) taken 1 times.
✓ Branch 4 (23→24) taken 1 times.
✓ Branch 6 (24→25) taken 1 times.
✓ Branch 8 (25→26) taken 1 times.
✓ Branch 10 (26→27) taken 1 times.
1 std::cout << "testStringhardware : hostName = '"<<hostName<<"', ipAddress = '"<<ipAddress<<"'" << std::endl;
23 1 return true;
24 1 }
25
26
27 1 int main(int argc, char** argv){
28 1 bool b(true);
29 1 b &= testStringhardware();
30 1 std::cout << "Final : b = " << b << std::endl;
31 1 return b - 1;
32 }
33
34
35