Directory: | ./ |
---|---|
File: | src/PMockConnector.cpp |
Date: | 2024-12-09 11:00:39 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 136 | 180 | 75.6% |
Branches: | 8 | 16 | 50.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 | |||
9 | |||
10 | #include "PMockConnector.h" | ||
11 | |||
12 | ///Constructor of class PMockEventVar | ||
13 | 251 | PMockEventVar::PMockEventVar(){ | |
14 |
1/1✓ Branch 1 taken 251 times.
|
251 | initialisationPMockEventVar(); |
15 | 251 | } | |
16 | |||
17 | ///Copy Constructor of class PMockEventVar | ||
18 | /** @param other : PMockEventVar we want ot copy | ||
19 | */ | ||
20 | 737 | PMockEventVar::PMockEventVar(const PMockEventVar & other){ | |
21 |
1/1✓ Branch 1 taken 737 times.
|
737 | copyPMockEventVar(other); |
22 | 737 | } | |
23 | |||
24 | ///Destructor of class PMockEventVar | ||
25 | 1976 | PMockEventVar::~PMockEventVar(){ | |
26 | |||
27 | } | ||
28 | |||
29 | ///Operator = of class PMockEventVar | ||
30 | /** @param other : PMockEventVar we want ot copy | ||
31 | * @return copied class PMockEventVar | ||
32 | */ | ||
33 | ✗ | PMockEventVar & PMockEventVar::operator = (const PMockEventVar & other){ | |
34 | ✗ | copyPMockEventVar(other); | |
35 | ✗ | return *this; | |
36 | } | ||
37 | |||
38 | ///Sets the eventId of the PMockEventVar | ||
39 | /** @param eventId : eventId of the PMockEventVar | ||
40 | */ | ||
41 | 151 | void PMockEventVar::setEventId(size_t eventId){ | |
42 | 151 | p_eventId = eventId; | |
43 | 151 | } | |
44 | |||
45 | ///Sets the vecData of the PMockEventVar | ||
46 | /** @param vecData : vecData of the PMockEventVar | ||
47 | */ | ||
48 | 151 | void PMockEventVar::setVecData(const std::vector<char> & vecData){ | |
49 | 151 | p_vecData = vecData; | |
50 | 151 | } | |
51 | |||
52 | ///Gets the eventId of the PMockEventVar | ||
53 | /** @return eventId of the PMockEventVar | ||
54 | */ | ||
55 | ✗ | size_t PMockEventVar::getEventId() const{ | |
56 | ✗ | return p_eventId; | |
57 | } | ||
58 | |||
59 | ///Gets the eventId of the PMockEventVar | ||
60 | /** @return eventId of the PMockEventVar | ||
61 | */ | ||
62 | 60 | size_t & PMockEventVar::getEventId(){ | |
63 | 60 | return p_eventId; | |
64 | } | ||
65 | |||
66 | ///Gets the vecData of the PMockEventVar | ||
67 | /** @return vecData of the PMockEventVar | ||
68 | */ | ||
69 | ✗ | const std::vector<char> & PMockEventVar::getVecData() const{ | |
70 | ✗ | return p_vecData; | |
71 | } | ||
72 | |||
73 | ///Gets the vecData of the PMockEventVar | ||
74 | /** @return vecData of the PMockEventVar | ||
75 | */ | ||
76 | 100 | std::vector<char> & PMockEventVar::getVecData(){ | |
77 | 100 | return p_vecData; | |
78 | } | ||
79 | |||
80 | ///Copy Function of class PMockEventVar | ||
81 | /** @param other : PMockEventVar we want ot copy | ||
82 | */ | ||
83 | 737 | void PMockEventVar::copyPMockEventVar(const PMockEventVar & other){ | |
84 | 737 | p_eventId = other.p_eventId; | |
85 | 737 | p_vecData = other.p_vecData; | |
86 | 737 | } | |
87 | |||
88 | ///Initialisation Function of class PMockEventVar | ||
89 | 251 | void PMockEventVar::initialisationPMockEventVar(){ | |
90 | 251 | p_eventId = 0lu; | |
91 | 251 | } | |
92 | |||
93 | ///Constructor of class PMockConnectorVar | ||
94 |
1/1✓ Branch 2 taken 47 times.
|
47 | PMockConnectorVar::PMockConnectorVar(){ |
95 |
1/1✓ Branch 1 taken 47 times.
|
47 | initialisationPMockConnectorVar(); |
96 | 47 | } | |
97 | |||
98 | ///Copy Constructor of class PMockConnectorVar | ||
99 | /** @param other : PMockConnectorVar we want ot copy | ||
100 | */ | ||
101 | ✗ | PMockConnectorVar::PMockConnectorVar(const PMockConnectorVar & other){ | |
102 | ✗ | copyPMockConnectorVar(other); | |
103 | } | ||
104 | |||
105 | ///Destructor of class PMockConnectorVar | ||
106 | 94 | PMockConnectorVar::~PMockConnectorVar(){ | |
107 | |||
108 | } | ||
109 | |||
110 | ///Operator = of class PMockConnectorVar | ||
111 | /** @param other : PMockConnectorVar we want ot copy | ||
112 | * @return copied class PMockConnectorVar | ||
113 | */ | ||
114 | 21 | PMockConnectorVar & PMockConnectorVar::operator = (const PMockConnectorVar & other){ | |
115 | 21 | copyPMockConnectorVar(other); | |
116 | 21 | return *this; | |
117 | } | ||
118 | |||
119 | ///Sets the fileNameMock of the PMockConnectorVar | ||
120 | /** @param fileNameMock : fileNameMock of the PMockConnectorVar | ||
121 | */ | ||
122 | 26 | void PMockConnectorVar::setFileNameMock(const std::string & fileNameMock){ | |
123 | 26 | p_fileNameMock = fileNameMock; | |
124 | 26 | } | |
125 | |||
126 | ///Sets the isWriteMode of the PMockConnectorVar | ||
127 | /** @param isWriteMode : isWriteMode of the PMockConnectorVar | ||
128 | */ | ||
129 | 26 | void PMockConnectorVar::setIsWriteMode(bool isWriteMode){ | |
130 | 26 | p_isWriteMode = isWriteMode; | |
131 | 26 | } | |
132 | |||
133 | ///Sets the currentInputMessageIndex of the PMockConnectorVar | ||
134 | /** @param currentInputMessageIndex : currentInputMessageIndex of the PMockConnectorVar | ||
135 | */ | ||
136 | 100 | void PMockConnectorVar::setCurrentInputMessageIndex(size_t currentInputMessageIndex){ | |
137 | 100 | p_currentInputMessageIndex = currentInputMessageIndex; | |
138 | 100 | } | |
139 | |||
140 | ///Sets the type of the PMockConnectorVar | ||
141 | /** @param type : type of the PMockConnectorVar | ||
142 | */ | ||
143 | 7 | void PMockConnectorVar::setType(const PComposeType & type){ | |
144 | 7 | p_type = type; | |
145 | 7 | } | |
146 | |||
147 | ///Sets the vecEvent of the PMockConnectorVar | ||
148 | /** @param vecEvent : vecEvent of the PMockConnectorVar | ||
149 | */ | ||
150 | ✗ | void PMockConnectorVar::setVecEvent(const std::vector<PMockEventVar> & vecEvent){ | |
151 | ✗ | p_vecEvent = vecEvent; | |
152 | } | ||
153 | |||
154 | ///Gets the fileNameMock of the PMockConnectorVar | ||
155 | /** @return fileNameMock of the PMockConnectorVar | ||
156 | */ | ||
157 | 37 | const std::string & PMockConnectorVar::getFileNameMock() const{ | |
158 | 37 | return p_fileNameMock; | |
159 | } | ||
160 | |||
161 | ///Gets the fileNameMock of the PMockConnectorVar | ||
162 | /** @return fileNameMock of the PMockConnectorVar | ||
163 | */ | ||
164 | ✗ | std::string & PMockConnectorVar::getFileNameMock(){ | |
165 | ✗ | return p_fileNameMock; | |
166 | } | ||
167 | |||
168 | ///Gets the isWriteMode of the PMockConnectorVar | ||
169 | /** @return isWriteMode of the PMockConnectorVar | ||
170 | */ | ||
171 | 21 | bool PMockConnectorVar::getIsWriteMode() const{ | |
172 | 21 | return p_isWriteMode; | |
173 | } | ||
174 | |||
175 | ///Gets the isWriteMode of the PMockConnectorVar | ||
176 | /** @return isWriteMode of the PMockConnectorVar | ||
177 | */ | ||
178 | 180 | bool & PMockConnectorVar::getIsWriteMode(){ | |
179 | 180 | return p_isWriteMode; | |
180 | } | ||
181 | |||
182 | ///Gets the currentInputMessageIndex of the PMockConnectorVar | ||
183 | /** @return currentInputMessageIndex of the PMockConnectorVar | ||
184 | */ | ||
185 | ✗ | size_t PMockConnectorVar::getCurrentInputMessageIndex() const{ | |
186 | ✗ | return p_currentInputMessageIndex; | |
187 | } | ||
188 | |||
189 | ///Gets the currentInputMessageIndex of the PMockConnectorVar | ||
190 | /** @return currentInputMessageIndex of the PMockConnectorVar | ||
191 | */ | ||
192 | 192 | size_t & PMockConnectorVar::getCurrentInputMessageIndex(){ | |
193 | 192 | return p_currentInputMessageIndex; | |
194 | } | ||
195 | |||
196 | ///Gets the type of the PMockConnectorVar | ||
197 | /** @return type of the PMockConnectorVar | ||
198 | */ | ||
199 | ✗ | const PComposeType & PMockConnectorVar::getType() const{ | |
200 | ✗ | return p_type; | |
201 | } | ||
202 | |||
203 | ///Gets the type of the PMockConnectorVar | ||
204 | /** @return type of the PMockConnectorVar | ||
205 | */ | ||
206 | ✗ | PComposeType & PMockConnectorVar::getType(){ | |
207 | ✗ | return p_type; | |
208 | } | ||
209 | |||
210 | ///Gets the vecEvent of the PMockConnectorVar | ||
211 | /** @return vecEvent of the PMockConnectorVar | ||
212 | */ | ||
213 | ✗ | const std::vector<PMockEventVar> & PMockConnectorVar::getVecEvent() const{ | |
214 | ✗ | return p_vecEvent; | |
215 | } | ||
216 | |||
217 | ///Gets the vecEvent of the PMockConnectorVar | ||
218 | /** @return vecEvent of the PMockConnectorVar | ||
219 | */ | ||
220 | 255 | std::vector<PMockEventVar> & PMockConnectorVar::getVecEvent(){ | |
221 | 255 | return p_vecEvent; | |
222 | } | ||
223 | |||
224 | ///Copy Function of class PMockConnectorVar | ||
225 | /** @param other : PMockConnectorVar we want ot copy | ||
226 | */ | ||
227 | 21 | void PMockConnectorVar::copyPMockConnectorVar(const PMockConnectorVar & other){ | |
228 | 21 | p_fileNameMock = other.p_fileNameMock; | |
229 | 21 | p_isWriteMode = other.p_isWriteMode; | |
230 | 21 | p_currentInputMessageIndex = other.p_currentInputMessageIndex; | |
231 | 21 | p_type = other.p_type; | |
232 | 21 | p_vecEvent = other.p_vecEvent; | |
233 | 21 | } | |
234 | |||
235 | ///Initialisation Function of class PMockConnectorVar | ||
236 | 47 | void PMockConnectorVar::initialisationPMockConnectorVar(){ | |
237 | 47 | p_fileNameMock = ""; | |
238 | 47 | p_isWriteMode = false; | |
239 | 47 | p_currentInputMessageIndex = 0lu; | |
240 | 47 | } | |
241 | |||
242 | ///Constructor of class PMockEventCall | ||
243 | 50 | PMockEventCall::PMockEventCall(){ | |
244 |
1/1✓ Branch 1 taken 50 times.
|
50 | initialisationPMockEventCall(); |
245 | 50 | } | |
246 | |||
247 | ///Copy Constructor of class PMockEventCall | ||
248 | /** @param other : PMockEventCall we want ot copy | ||
249 | */ | ||
250 | 146 | PMockEventCall::PMockEventCall(const PMockEventCall & other){ | |
251 |
1/1✓ Branch 1 taken 146 times.
|
146 | copyPMockEventCall(other); |
252 | 146 | } | |
253 | |||
254 | ///Destructor of class PMockEventCall | ||
255 | 392 | PMockEventCall::~PMockEventCall(){ | |
256 | |||
257 | } | ||
258 | |||
259 | ///Operator = of class PMockEventCall | ||
260 | /** @param other : PMockEventCall we want ot copy | ||
261 | * @return copied class PMockEventCall | ||
262 | */ | ||
263 | ✗ | PMockEventCall & PMockEventCall::operator = (const PMockEventCall & other){ | |
264 | ✗ | copyPMockEventCall(other); | |
265 | ✗ | return *this; | |
266 | } | ||
267 | |||
268 | ///Sets the eventId of the PMockEventCall | ||
269 | /** @param eventId : eventId of the PMockEventCall | ||
270 | */ | ||
271 | 30 | void PMockEventCall::setEventId(size_t eventId){ | |
272 | 30 | p_eventId = eventId; | |
273 | 30 | } | |
274 | |||
275 | ///Sets the vecParam of the PMockEventCall | ||
276 | /** @param vecParam : vecParam of the PMockEventCall | ||
277 | */ | ||
278 | 30 | void PMockEventCall::setVecParam(const std::vector<std::vector<char> > & vecParam){ | |
279 | 30 | p_vecParam = vecParam; | |
280 | 30 | } | |
281 | |||
282 | ///Sets the vecResult of the PMockEventCall | ||
283 | /** @param vecResult : vecResult of the PMockEventCall | ||
284 | */ | ||
285 | 10 | void PMockEventCall::setVecResult(const std::vector<std::vector<char> > & vecResult){ | |
286 | 10 | p_vecResult = vecResult; | |
287 | 10 | } | |
288 | |||
289 | ///Gets the eventId of the PMockEventCall | ||
290 | /** @return eventId of the PMockEventCall | ||
291 | */ | ||
292 | ✗ | size_t PMockEventCall::getEventId() const{ | |
293 | ✗ | return p_eventId; | |
294 | } | ||
295 | |||
296 | ///Gets the eventId of the PMockEventCall | ||
297 | /** @return eventId of the PMockEventCall | ||
298 | */ | ||
299 | 20 | size_t & PMockEventCall::getEventId(){ | |
300 | 20 | return p_eventId; | |
301 | } | ||
302 | |||
303 | ///Gets the vecParam of the PMockEventCall | ||
304 | /** @return vecParam of the PMockEventCall | ||
305 | */ | ||
306 | ✗ | const std::vector<std::vector<char> > & PMockEventCall::getVecParam() const{ | |
307 | ✗ | return p_vecParam; | |
308 | } | ||
309 | |||
310 | ///Gets the vecParam of the PMockEventCall | ||
311 | /** @return vecParam of the PMockEventCall | ||
312 | */ | ||
313 | ✗ | std::vector<std::vector<char> > & PMockEventCall::getVecParam(){ | |
314 | ✗ | return p_vecParam; | |
315 | } | ||
316 | |||
317 | ///Gets the vecResult of the PMockEventCall | ||
318 | /** @return vecResult of the PMockEventCall | ||
319 | */ | ||
320 | ✗ | const std::vector<std::vector<char> > & PMockEventCall::getVecResult() const{ | |
321 | ✗ | return p_vecResult; | |
322 | } | ||
323 | |||
324 | ///Gets the vecResult of the PMockEventCall | ||
325 | /** @return vecResult of the PMockEventCall | ||
326 | */ | ||
327 | 20 | std::vector<std::vector<char> > & PMockEventCall::getVecResult(){ | |
328 | 20 | return p_vecResult; | |
329 | } | ||
330 | |||
331 | ///Copy Function of class PMockEventCall | ||
332 | /** @param other : PMockEventCall we want ot copy | ||
333 | */ | ||
334 | 146 | void PMockEventCall::copyPMockEventCall(const PMockEventCall & other){ | |
335 | 146 | p_eventId = other.p_eventId; | |
336 | 146 | p_vecParam = other.p_vecParam; | |
337 | 146 | p_vecResult = other.p_vecResult; | |
338 | 146 | } | |
339 | |||
340 | ///Initialisation Function of class PMockEventCall | ||
341 | 50 | void PMockEventCall::initialisationPMockEventCall(){ | |
342 | 50 | p_eventId = 0lu; | |
343 | 50 | } | |
344 | |||
345 | ///Constructor of class PMockConnectorCall | ||
346 |
1/1✓ Branch 2 taken 8 times.
|
8 | PMockConnectorCall::PMockConnectorCall(){ |
347 |
1/1✓ Branch 1 taken 8 times.
|
8 | initialisationPMockConnectorCall(); |
348 | 8 | } | |
349 | |||
350 | ///Copy Constructor of class PMockConnectorCall | ||
351 | /** @param other : PMockConnectorCall we want ot copy | ||
352 | */ | ||
353 | ✗ | PMockConnectorCall::PMockConnectorCall(const PMockConnectorCall & other){ | |
354 | ✗ | copyPMockConnectorCall(other); | |
355 | } | ||
356 | |||
357 | ///Destructor of class PMockConnectorCall | ||
358 | 16 | PMockConnectorCall::~PMockConnectorCall(){ | |
359 | |||
360 | } | ||
361 | |||
362 | ///Operator = of class PMockConnectorCall | ||
363 | /** @param other : PMockConnectorCall we want ot copy | ||
364 | * @return copied class PMockConnectorCall | ||
365 | */ | ||
366 | 3 | PMockConnectorCall & PMockConnectorCall::operator = (const PMockConnectorCall & other){ | |
367 | 3 | copyPMockConnectorCall(other); | |
368 | 3 | return *this; | |
369 | } | ||
370 | |||
371 | ///Sets the fileNameMock of the PMockConnectorCall | ||
372 | /** @param fileNameMock : fileNameMock of the PMockConnectorCall | ||
373 | */ | ||
374 | 5 | void PMockConnectorCall::setFileNameMock(const std::string & fileNameMock){ | |
375 | 5 | p_fileNameMock = fileNameMock; | |
376 | 5 | } | |
377 | |||
378 | ///Sets the isWriteMode of the PMockConnectorCall | ||
379 | /** @param isWriteMode : isWriteMode of the PMockConnectorCall | ||
380 | */ | ||
381 | 5 | void PMockConnectorCall::setIsWriteMode(bool isWriteMode){ | |
382 | 5 | p_isWriteMode = isWriteMode; | |
383 | 5 | } | |
384 | |||
385 | ///Sets the currentInputMessageIndex of the PMockConnectorCall | ||
386 | /** @param currentInputMessageIndex : currentInputMessageIndex of the PMockConnectorCall | ||
387 | */ | ||
388 | 22 | void PMockConnectorCall::setCurrentInputMessageIndex(size_t currentInputMessageIndex){ | |
389 | 22 | p_currentInputMessageIndex = currentInputMessageIndex; | |
390 | 22 | } | |
391 | |||
392 | ///Sets the prototype of the PMockConnectorCall | ||
393 | /** @param prototype : prototype of the PMockConnectorCall | ||
394 | */ | ||
395 | 2 | void PMockConnectorCall::setPrototype(const PFunctionPrototype & prototype){ | |
396 | 2 | p_prototype = prototype; | |
397 | 2 | } | |
398 | |||
399 | ///Sets the vecEvent of the PMockConnectorCall | ||
400 | /** @param vecEvent : vecEvent of the PMockConnectorCall | ||
401 | */ | ||
402 | ✗ | void PMockConnectorCall::setVecEvent(const std::vector<PMockEventCall> & vecEvent){ | |
403 | ✗ | p_vecEvent = vecEvent; | |
404 | } | ||
405 | |||
406 | ///Gets the fileNameMock of the PMockConnectorCall | ||
407 | /** @return fileNameMock of the PMockConnectorCall | ||
408 | */ | ||
409 | 6 | const std::string & PMockConnectorCall::getFileNameMock() const{ | |
410 | 6 | return p_fileNameMock; | |
411 | } | ||
412 | |||
413 | ///Gets the fileNameMock of the PMockConnectorCall | ||
414 | /** @return fileNameMock of the PMockConnectorCall | ||
415 | */ | ||
416 | ✗ | std::string & PMockConnectorCall::getFileNameMock(){ | |
417 | ✗ | return p_fileNameMock; | |
418 | } | ||
419 | |||
420 | ///Gets the isWriteMode of the PMockConnectorCall | ||
421 | /** @return isWriteMode of the PMockConnectorCall | ||
422 | */ | ||
423 | 3 | bool PMockConnectorCall::getIsWriteMode() const{ | |
424 | 3 | return p_isWriteMode; | |
425 | } | ||
426 | |||
427 | ///Gets the isWriteMode of the PMockConnectorCall | ||
428 | /** @return isWriteMode of the PMockConnectorCall | ||
429 | */ | ||
430 | 27 | bool & PMockConnectorCall::getIsWriteMode(){ | |
431 | 27 | return p_isWriteMode; | |
432 | } | ||
433 | |||
434 | ///Gets the currentInputMessageIndex of the PMockConnectorCall | ||
435 | /** @return currentInputMessageIndex of the PMockConnectorCall | ||
436 | */ | ||
437 | ✗ | size_t PMockConnectorCall::getCurrentInputMessageIndex() const{ | |
438 | ✗ | return p_currentInputMessageIndex; | |
439 | } | ||
440 | |||
441 | ///Gets the currentInputMessageIndex of the PMockConnectorCall | ||
442 | /** @return currentInputMessageIndex of the PMockConnectorCall | ||
443 | */ | ||
444 | 40 | size_t & PMockConnectorCall::getCurrentInputMessageIndex(){ | |
445 | 40 | return p_currentInputMessageIndex; | |
446 | } | ||
447 | |||
448 | ///Gets the prototype of the PMockConnectorCall | ||
449 | /** @return prototype of the PMockConnectorCall | ||
450 | */ | ||
451 | ✗ | const PFunctionPrototype & PMockConnectorCall::getPrototype() const{ | |
452 | ✗ | return p_prototype; | |
453 | } | ||
454 | |||
455 | ///Gets the prototype of the PMockConnectorCall | ||
456 | /** @return prototype of the PMockConnectorCall | ||
457 | */ | ||
458 | 20 | PFunctionPrototype & PMockConnectorCall::getPrototype(){ | |
459 | 20 | return p_prototype; | |
460 | } | ||
461 | |||
462 | ///Gets the vecEvent of the PMockConnectorCall | ||
463 | /** @return vecEvent of the PMockConnectorCall | ||
464 | */ | ||
465 | ✗ | const std::vector<PMockEventCall> & PMockConnectorCall::getVecEvent() const{ | |
466 | ✗ | return p_vecEvent; | |
467 | } | ||
468 | |||
469 | ///Gets the vecEvent of the PMockConnectorCall | ||
470 | /** @return vecEvent of the PMockConnectorCall | ||
471 | */ | ||
472 | 52 | std::vector<PMockEventCall> & PMockConnectorCall::getVecEvent(){ | |
473 | 52 | return p_vecEvent; | |
474 | } | ||
475 | |||
476 | ///Copy Function of class PMockConnectorCall | ||
477 | /** @param other : PMockConnectorCall we want ot copy | ||
478 | */ | ||
479 | 3 | void PMockConnectorCall::copyPMockConnectorCall(const PMockConnectorCall & other){ | |
480 | 3 | p_fileNameMock = other.p_fileNameMock; | |
481 | 3 | p_isWriteMode = other.p_isWriteMode; | |
482 | 3 | p_currentInputMessageIndex = other.p_currentInputMessageIndex; | |
483 | 3 | p_prototype = other.p_prototype; | |
484 | 3 | p_vecEvent = other.p_vecEvent; | |
485 | 3 | } | |
486 | |||
487 | ///Initialisation Function of class PMockConnectorCall | ||
488 | 8 | void PMockConnectorCall::initialisationPMockConnectorCall(){ | |
489 | 8 | p_fileNameMock = ""; | |
490 | 8 | p_isWriteMode = false; | |
491 | 8 | p_currentInputMessageIndex = 0lu; | |
492 | 8 | } | |
493 | |||
494 |