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