| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "Graph.h" | ||
| 8 | |||
| 9 | ///Test the graph conversion to dot | ||
| 10 | 1 | void testGraphToDot(){ | |
| 11 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | Graph<bool, long> graph; |
| 12 | |||
| 13 |
2/2✓ Branch 0 (5→6) taken 1 times.
✓ Branch 2 (6→7) taken 1 times.
|
2 | long nodeA = graph.createNode(true, "a"); |
| 14 |
2/2✓ Branch 0 (11→12) taken 1 times.
✓ Branch 2 (12→13) taken 1 times.
|
2 | long nodeB = graph.createNode(true, "b"); |
| 15 |
2/2✓ Branch 0 (17→18) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
|
2 | long nodeC = graph.createNode(true, "c"); |
| 16 |
2/2✓ Branch 0 (23→24) taken 1 times.
✓ Branch 2 (24→25) taken 1 times.
|
2 | long nodeD = graph.createNode(true, "d"); |
| 17 |
2/2✓ Branch 0 (29→30) taken 1 times.
✓ Branch 2 (30→31) taken 1 times.
|
2 | long nodeE = graph.createNode(true, "e"); |
| 18 | |||
| 19 |
2/2✓ Branch 0 (35→36) taken 1 times.
✓ Branch 2 (36→37) taken 1 times.
|
1 | long nodeRemove = graph.createNode(true, "to be removed"); |
| 20 | |||
| 21 |
1/1✓ Branch 0 (39→40) taken 1 times.
|
1 | graph.connectNode(nodeA, nodeC); |
| 22 |
1/1✓ Branch 0 (40→41) taken 1 times.
|
1 | graph.connectNode(nodeB, nodeC); |
| 23 |
1/1✓ Branch 0 (41→42) taken 1 times.
|
1 | graph.connectNode(nodeC, nodeE); |
| 24 |
1/1✓ Branch 0 (42→43) taken 1 times.
|
1 | graph.connectNode(nodeD, nodeE); |
| 25 | |||
| 26 |
1/1✓ Branch 0 (43→44) taken 1 times.
|
1 | graph.connectNode(nodeB, nodeRemove); |
| 27 |
1/1✓ Branch 0 (44→45) taken 1 times.
|
1 | graph.connectNode(nodeRemove, nodeE); |
| 28 | |||
| 29 |
2/2✓ Branch 0 (47→48) taken 1 times.
✓ Branch 2 (48→49) taken 1 times.
|
1 | graph.savePng("testGraphBase.png"); |
| 30 | |||
| 31 |
1/1✓ Branch 0 (51→52) taken 1 times.
|
1 | Graph<bool, long> graphLinkedRemove(graph); |
| 32 |
1/1✓ Branch 0 (52→53) taken 1 times.
|
1 | graph.removeNode(nodeRemove); |
| 33 | |||
| 34 |
2/2✓ Branch 0 (55→56) taken 1 times.
✓ Branch 2 (56→57) taken 1 times.
|
1 | graph.savePng("testGraphRemove.png"); |
| 35 | |||
| 36 |
1/1✓ Branch 0 (59→60) taken 1 times.
|
1 | graphLinkedRemove.removeNode(nodeRemove, true); |
| 37 |
2/2✓ Branch 0 (62→63) taken 1 times.
✓ Branch 2 (63→64) taken 1 times.
|
1 | graphLinkedRemove.savePng("testGraphLinkedRemove.png"); |
| 38 | 1 | } | |
| 39 | |||
| 40 | |||
| 41 | 1 | int main(int argc, char** argv){ | |
| 42 | 1 | testGraphToDot(); | |
| 43 | 1 | return 0; | |
| 44 | } | ||
| 45 | |||
| 46 | |||
| 47 |