diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-02-21 22:26:23 -0800 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-02-21 22:26:23 -0800 |
commit | 019679a55f48046079b8599bde215379a1708bdb (patch) | |
tree | 73ec92967adb2fd230b5a285eb04bf1ae6aefef8 | |
parent | 55d4c92c421ce993d6ba36dcb935dec94a214d80 (diff) |
Fix naming
-rw-r--r-- | graph.c | 2 | ||||
-rw-r--r-- | graph.h | 2 | ||||
-rw-r--r-- | graph.test.c | 14 |
3 files changed, 9 insertions, 9 deletions
@@ -22,7 +22,7 @@ int graph_insertNode(struct graph_Graph_t *g, struct graph_Node_t *toInsert, return NULL_GRAPH_DEREF; if (toInsert->value == NULL) return EMPTY_NODE_ERR; - if (toConnect->nArcs + 1 > toConnect->maxNEdges) + if (toConnect->nArcs + 1 > toConnect->maxNArcs) return NODE_OUT_OF_MEM; toInsert->id = id++; @@ -9,7 +9,7 @@ struct graph_Node_t { int id; void *value; // point to anything and live on the edge int nArcs; - int maxNEdges; + int maxNArcs; struct graph_Node_t **arcs; }; diff --git a/graph.test.c b/graph.test.c index 8e82efa..39c04dd 100644 --- a/graph.test.c +++ b/graph.test.c @@ -16,7 +16,7 @@ int makeGraphEmptyNode() { int makeGraphSuccess() { struct graph_Graph_t g; int val = 5; - struct graph_Node_t n = {.value = &val, .maxNEdges = 1024}; + struct graph_Node_t n = {.value = &val, .maxNArcs = 1024}; return graph_makeGraph(&g, &n) != 0; } @@ -24,7 +24,7 @@ int insertNodeNullDeref() { struct graph_Graph_t g; double val = 6; struct graph_Node_t *arcsN[1024]; - struct graph_Node_t n = {.value = &val, .maxNEdges = 1024, .arcs = arcsN}; + struct graph_Node_t n = {.value = &val, .maxNArcs = 1024, .arcs = arcsN}; graph_makeGraph(&g, &n); return graph_insertNode(&g, &n, NULL) != NULL_GRAPH_DEREF; } @@ -33,7 +33,7 @@ int insertNodeEmptyNode() { struct graph_Graph_t g; double val = 7; struct graph_Node_t *arcsN[1024]; - struct graph_Node_t n = {.value = &val, .maxNEdges = 1024, .arcs = arcsN}; + struct graph_Node_t n = {.value = &val, .maxNArcs = 1024, .arcs = arcsN}; struct graph_Node_t m = {.value = NULL}; graph_makeGraph(&g, &n); return graph_insertNode(&g, &m, &n) != EMPTY_NODE_ERR; @@ -43,9 +43,9 @@ int insertNodeOutOfMem() { struct graph_Graph_t g; double val = 8; struct graph_Node_t *arcsM[1024]; - struct graph_Node_t m = {.value = &val, .maxNEdges = 1024, .arcs = arcsM}; + struct graph_Node_t m = {.value = &val, .maxNArcs = 1024, .arcs = arcsM}; struct graph_Node_t n = { - .value = &val, .maxNEdges = 0, .arcs = NULL, .nArcs = 0}; + .value = &val, .maxNArcs = 0, .arcs = NULL, .nArcs = 0}; graph_makeGraph(&g, &n); return graph_insertNode(&g, &m, &n) != NODE_OUT_OF_MEM; } @@ -55,9 +55,9 @@ int insertNodeSuccess() { double val = 9; struct graph_Node_t *arcsN[1024], *arcsM[1024]; struct graph_Node_t m = { - .value = &val, .maxNEdges = 1024, .arcs = arcsM, .nArcs = 0}; + .value = &val, .maxNArcs = 1024, .arcs = arcsM, .nArcs = 0}; struct graph_Node_t n = { - .value = &val, .maxNEdges = 1024, .arcs = arcsN, .nArcs = 0}; + .value = &val, .maxNArcs = 1024, .arcs = arcsN, .nArcs = 0}; graph_makeGraph(&g, &n); return graph_insertNode(&g, &m, &n) != 0; } |