| 35 | } EdgeDesc; |
| 36 | |
| 37 | void _test_node_creation(Graph *g, size_t node_count) { |
| 38 | GrB_Index ncols, nrows, nvals; |
| 39 | |
| 40 | // Create nodes. |
| 41 | Node n; |
| 42 | for(uint i = 0; i < node_count; i++) { |
| 43 | n = GE_NEW_NODE(); |
| 44 | Graph_CreateNode(g, &n, NULL, 0); |
| 45 | } |
| 46 | |
| 47 | // Validate nodes creation. |
| 48 | RG_Matrix adj = Graph_GetAdjacencyMatrix(g, false); |
| 49 | TEST_ASSERT(RG_Matrix_nrows(&nrows, adj) == GrB_SUCCESS); |
| 50 | TEST_ASSERT(RG_Matrix_ncols(&ncols, adj) == GrB_SUCCESS); |
| 51 | TEST_ASSERT(RG_Matrix_nvals(&nvals, adj) == GrB_SUCCESS); |
| 52 | |
| 53 | TEST_ASSERT(nvals == 0); // No connection were formed. |
| 54 | TEST_ASSERT(ncols >= Graph_NodeCount(g)); // Graph's adjacency matrix dimensions. |
| 55 | TEST_ASSERT(nrows >= Graph_NodeCount(g)); |
| 56 | TEST_ASSERT(Graph_NodeCount(g) == node_count); |
| 57 | } |
| 58 | |
| 59 | /* TODO benchmark functions are currently not invoked */ |
| 60 | void benchmark_node_creation_with_labels() { |
no test coverage detected