Directory: | ./ |
---|---|
File: | TESTS/TEST_DAEMON_SEND_DATA/SendDataDaemon.cpp |
Date: | 2025-03-27 14:50:11 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 16 | 16 | 100.0% |
Branches: | 8 | 8 | 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 | |||
8 | #include "SendDataDaemon.h" | ||
9 | |||
10 | ///Default constructor of SendDataDaemon | ||
11 | 2 | SendDataDaemon::SendDataDaemon(){ | |
12 | 2 | initialisationSendDataDaemon(); | |
13 | 2 | } | |
14 | |||
15 | ///Destructor of SendDataDaemon | ||
16 | 4 | SendDataDaemon::~SendDataDaemon(){ | |
17 | |||
18 | } | ||
19 | |||
20 | ///Extra processing (here to test Ping-Pong mode) | ||
21 | 4 | void SendDataDaemon::extraLoopProcessing(){ | |
22 | //Let's send the Ping message to get the answer | ||
23 | 4 | sendInt(); | |
24 | 4 | } | |
25 | |||
26 | ///Initialisation function of the class SendDataDaemon | ||
27 | 2 | void SendDataDaemon::initialisationSendDataDaemon(){ | |
28 | 2 | p_isFirstSend = true; | |
29 | 2 | } | |
30 | |||
31 | ///Send a Ping message | ||
32 | 4 | void SendDataDaemon::sendInt(){ | |
33 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
|
4 | if(!p_isFirstSend){ |
34 | 2 | return; | |
35 | } | ||
36 | 2 | int data = 42; | |
37 |
6/6✓ Branch 2 taken 2 times.
✓ Branch 6 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 19 taken 2 times.
|
2 | phoenix_assert(sendValue("test", data)); |
38 | 2 | p_isFirstSend = false; | |
39 | } | ||
40 | |||
41 |