test suite for igraph_ring.c
Bug #712913 reported by
Minh Van Nguyen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
New
|
Undecided
|
Unassigned |
Bug Description
As of revision 2309, the test suite for rings in examples/
Related branches
To post a comment you must log in.
After carefully checking my previous patch, I noticed some problems I missed. See the new patch. Here are additions in the new patch:
--- ring-test- suite.diff 2011-02-05 10:00:39.427174071 +1100 suite2. diff 2011-02-05 10:01:35.135174070 +1100 simple/ igraph_ ring.c' simple/ igraph_ ring.c 2006-03-04 15:49:27 +0000 simple/ igraph_ ring.c 2011-02-04 04:40:40 +0000 simple/ igraph_ ring.c 2011-02-04 22:38:34 +0000 FINALLY_ CLEAN(1) ; FINALLY_ CLEAN(1) ; vector_ size(&v) ) { vector_ destroy( &v); FINALLY_ CLEAN(1) ; VECTOR_ INIT_FINALLY( &v, n); CHECK(igraph_ degree( &g, &v, igraph_vss_all(), IGRAPH_ALL, FINALLY_ CLEAN(1) ; FINALLY_ CLEAN(1) ; FINALLY_ CLEAN(1) ;
+++ ring-test-
@@ -1,7 +1,7 @@
=== modified file 'examples/
--- examples/
-+++ examples/
-@@ -1,29 +1,841 @@
++++ examples/
+@@ -1,29 +1,847 @@
/* -*- mode: C -*- */
-/*
+/*
@@ -70,7 +70,7 @@
+ /* number of vertices = number of edges */
+ nedges = igraph_ecount(&g);
+ nverts = igraph_vcount(&g);
-+ if ((n != nverts) || (nverts != nedges)) {
++ if (n != nverts || nverts != nedges) {
+ return 3;
+ }
+ /* girth = number of vertices */
@@ -139,6 +139,7 @@
+ return 11;
+ }
+ igraph_destroy(&g);
++ IGRAPH_
+
+ /* Boundary case: undirected (circular) ring on two vertices. */
+ /* The generated ring is the undirected graph with two vertices, which */
@@ -285,6 +286,7 @@
+ return 28;
+ }
+ igraph_destroy(&g);
++ IGRAPH_
+
+ /* Boundary case: undirected noncircular ring on two vertices. */
+ /* The generated ring is equivalent to the undirected graph with two */
@@ -443,7 +445,8 @@
+ if (0 != igraph_
+ return 47;
+ }
-+ igraph_destroy(&g);
++ igraph_
++ IGRAPH_
+ IGRAPH_
+ IGRAPH_
+ IGRAPH_LOOPS));
@@ -465,6 +468,7 @@
+ return 49;
+ }
+ igraph_destroy(&g);
++ IGRAPH_
+
+ /* Boundary case: directed circular ring on two vertices. */
+ /* This is equivalent to a directed version of the line graph on two */
@@ -654,6 +658,7 @@
+ return 70;
+ }
+ igraph_destroy(&g);
++ IGRAPH_
+
+ /* Boundary case: directed noncircular ring on one vertex. */
+ /* There is no such ring. The generated graph is the null graph. */
@@ -666,6 +671,7 @@
+ return 71;
+ }
+ igraph_destroy(&g);
++ IGRAPH_
+
+ /* Boundary case: directed noncircular ring on two vertices. */
+ /* The generated ring is equivalent to a directed version of the line */
If you think the patch is too long, I can separate it out into logical chunks to help with the review process.