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 <vector> | ||
10 | #include "phoenix_template_alloc.h" | ||
11 | |||
12 | ///Test the copy shape | ||
13 | /** @return true on success, false otherwise | ||
14 | */ | ||
15 | 1 | bool testCopyShape(){ | |
16 |
1/1✓ Branch 0 (4→5) taken 1 times.
|
2 | std::vector<size_t> vecShape{1lu, 2lu, 3lu}; |
17 | 1 | size_t * destShape = NULL, destNbDim(0lu); | |
18 | |||
19 | 1 | bool b(true); | |
20 |
1/1✓ Branch 0 (7→8) taken 1 times.
|
1 | phoenix_copyShape(destShape, destNbDim, NULL, vecShape.size()); |
21 |
1/1✓ Branch 0 (8→9) taken 1 times.
|
1 | b &= phoenix_isSameShape(NULL, 0lu, NULL, 0lu); |
22 |
1/1✓ Branch 0 (10→11) taken 1 times.
|
1 | phoenix_copyShape(destShape, destNbDim, vecShape.data(), 0lu); |
23 |
1/1✓ Branch 0 (11→12) taken 1 times.
|
1 | b &= phoenix_isSameShape(NULL, 0lu, NULL, 0lu); |
24 |
1/1✓ Branch 0 (12→13) taken 1 times.
|
1 | phoenix_copyShape(destShape, destNbDim, NULL, 0lu); |
25 |
1/1✓ Branch 0 (13→14) taken 1 times.
|
1 | b &= phoenix_isSameShape(NULL, 0lu, NULL, 0lu); |
26 | |||
27 |
1/1✓ Branch 0 (16→17) taken 1 times.
|
1 | phoenix_copyShape(destShape, destNbDim, vecShape.data(), vecShape.size()); |
28 |
1/1✓ Branch 0 (19→20) taken 1 times.
|
1 | b &= phoenix_isSameShape(destShape, destNbDim, vecShape.data(), vecShape.size()); |
29 |
1/1✓ Branch 0 (22→23) taken 1 times.
|
1 | phoenix_copyShape(destShape, destNbDim, vecShape.data(), vecShape.size()); |
30 |
1/1✓ Branch 0 (25→26) taken 1 times.
|
1 | b &= phoenix_isSameShape(destShape, destNbDim, vecShape.data(), vecShape.size()); |
31 | |||
32 |
1/1✓ Branch 0 (26→27) taken 1 times.
|
1 | b &= phoenix_isSameShape(NULL, 0lu, NULL, 0lu); |
33 |
1/1✓ Branch 0 (28→29) taken 1 times.
|
1 | b &= !phoenix_isSameShape(destShape, destNbDim, NULL, vecShape.size()); |
34 |
1/1✓ Branch 0 (31→32) taken 1 times.
|
1 | b &= !phoenix_isSameShape(NULL, destNbDim, vecShape.data(), vecShape.size()); |
35 |
1/1✓ Branch 0 (34→35) taken 1 times.
|
1 | b &= !phoenix_isSameShape(NULL, 0lu, vecShape.data(), vecShape.size()); |
36 |
1/1✓ Branch 0 (35→36) taken 1 times.
|
1 | b &= !phoenix_isSameShape(destShape, destNbDim, NULL, 0lu); |
37 | |||
38 |
1/2✓ Branch 0 (36→37) taken 1 times.
✗ Branch 1 (36→38) not taken.
|
1 | delete [] destShape; |
39 | |||
40 |
1/1✓ Branch 0 (40→41) taken 1 times.
|
2 | std::vector<size_t> vecOtherShape{1lu, 2lu, 4lu}; |
41 |
1/1✓ Branch 0 (46→47) taken 1 times.
|
1 | b &= !phoenix_isSameShape(vecOtherShape.data(), vecOtherShape.size(), vecShape.data(), vecShape.size()); |
42 | |||
43 |
3/3✓ Branch 0 (47→48) taken 1 times.
✓ Branch 2 (48→49) taken 1 times.
✓ Branch 4 (49→50) taken 1 times.
|
1 | std::cout << "testCopyShape : b = " << b << std::endl; |
44 | 1 | return b; | |
45 | 1 | } | |
46 | |||
47 | |||
48 | 1 | int main(int argc, char** argv){ | |
49 | 1 | bool b(true); | |
50 | 1 | b &= testCopyShape(); | |
51 | 1 | std::cout << "Final : b = " << b << std::endl; | |
52 | 1 | return b - 1; | |
53 | } | ||
54 | |||
55 | |||
56 |