Created
January 29, 2014 12:18
-
-
Save streamer45/8686811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/kr_graph_test.c b/tests/kr_graph_test.c | |
index 0bcd36b..b2c44a2 100644 | |
--- a/tests/kr_graph_test.c | |
+++ b/tests/kr_graph_test.c | |
@@ -58,7 +58,7 @@ int random_vertices_gen(kr_graph *graph, int n, kr_vertex **vertices) { | |
int i; | |
int k; | |
for (i = k = 0; i < n; i++) { | |
- vertices[k] = kr_graph_vertex_create(graph,randr(1,3)); | |
+ vertices[k] = kr_graph_vertex_create(graph,randr(1,4),NULL); | |
if (vertices[k]) { | |
k++; | |
} | |
@@ -73,10 +73,10 @@ int random_edges_gen(kr_graph *graph, int n, int vcount, kr_vertex **vertices) { | |
int l; | |
for (i = l = 0; i < n; i++) { | |
- j = randr(0,vcount-1); | |
- k = randr(0,vcount-1); | |
+ j = randr(0,vcount); | |
+ k = randr(0,vcount); | |
printf("Generating random edge from %p to %p\n",vertices[k],vertices[j]); | |
- if (!kr_graph_edge_create(graph,vertices[j],vertices[k])) { | |
+ if (!kr_graph_edge_create(graph,vertices[j],vertices[k],NULL)) { | |
l++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment