| 17 | #include "acutest.h" |
| 18 | |
| 19 | static Graph *BuildGraph() { |
| 20 | Edge e; |
| 21 | Node n; |
| 22 | size_t nodeCount = 4; |
| 23 | Graph *g = Graph_New(nodeCount, nodeCount); |
| 24 | int relation = Graph_AddRelationType(g); |
| 25 | for(int i = 0; i < 4; i++) { |
| 26 | n = GE_NEW_NODE(); |
| 27 | Graph_CreateNode(g, &n, NULL, 0); |
| 28 | } |
| 29 | |
| 30 | /* Connections: |
| 31 | * 0 -> 1 |
| 32 | * 0 -> 2 |
| 33 | * 1 -> 0 |
| 34 | * 1 -> 2 |
| 35 | * 2 -> 1 |
| 36 | * 2 -> 3 |
| 37 | * 3 -> 0 */ |
| 38 | |
| 39 | // Connections: |
| 40 | // 0 -> 1 |
| 41 | Graph_CreateEdge(g, 0, 1, relation, &e); |
| 42 | // 0 -> 2 |
| 43 | Graph_CreateEdge(g, 0, 2, relation, &e); |
| 44 | // 1 -> 0 |
| 45 | Graph_CreateEdge(g, 1, 0, relation, &e); |
| 46 | // 1 -> 2 |
| 47 | Graph_CreateEdge(g, 1, 2, relation, &e); |
| 48 | // 2 -> 1 |
| 49 | Graph_CreateEdge(g, 2, 1, relation, &e); |
| 50 | // 2 -> 3 |
| 51 | Graph_CreateEdge(g, 2, 3, relation, &e); |
| 52 | // 3 -> 0 |
| 53 | Graph_CreateEdge(g, 3, 0, relation, &e); |
| 54 | return g; |
| 55 | } |
| 56 | |
| 57 | // This function tests for membership of a path, inside an array of multiple paths. |
| 58 | bool pathArrayContainsPath(NodeID **array, int arrayLen, Path *path) { |
no test coverage detected