| 324 | } |
| 325 | |
| 326 | void test_getNode() { |
| 327 | /* Create a graph with nodeCount nodes, |
| 328 | * Make sure node retrival works as expected: |
| 329 | * try to get nodes (0 - nodeCount) */ |
| 330 | |
| 331 | Node n; |
| 332 | size_t nodeCount = 16; |
| 333 | Graph *g = Graph_New(nodeCount, nodeCount); |
| 334 | |
| 335 | Graph_AcquireWriteLock(g); |
| 336 | { |
| 337 | for(int i = 0 ; i < nodeCount; i++) { |
| 338 | n = GE_NEW_NODE(); |
| 339 | Graph_CreateNode(g, &n, NULL, 0); |
| 340 | } |
| 341 | } |
| 342 | Graph_ReleaseLock(g); |
| 343 | |
| 344 | // Get nodes 0 - nodeCount. |
| 345 | NodeID i = 0; |
| 346 | for(; i < nodeCount; i++) { |
| 347 | Graph_GetNode(g, i, &n); |
| 348 | TEST_ASSERT(n.attributes != NULL); |
| 349 | } |
| 350 | |
| 351 | Graph_Free(g); |
| 352 | } |
| 353 | |
| 354 | void test_getEdge() { |
| 355 | /* Create a graph with both nodes and edges. |
nothing calls this directly
no test coverage detected