Skip to content

Commit 31ccdae

Browse files
test_diameter: check scalar results (exact diameter)
1 parent 64133fc commit 31ccdae

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

experimental/test/test_diameter.c

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
//------------------------------------------------------------------------------
1717

18-
// FIXME: need to check the results with correct their values
18+
// FIXME: vector results (peripheral, eccentricity, level, and parent) are not
19+
// checked with exact values
1920

2021
#include <stdio.h>
2122
#include <acutest.h>
@@ -39,24 +40,25 @@ char filename [LEN+1] ;
3940

4041
typedef struct
4142
{
43+
int diameter ;
4244
bool symmetric ;
4345
const char *name ;
4446
}
4547
matrix_info ;
4648

4749
const matrix_info files [ ] =
4850
{
49-
{ 1, "A.mtx" },
50-
{ 1, "jagmesh7.mtx" },
51-
{ 0, "west0067.mtx" }, // unsymmetric
52-
{ 1, "bcsstk13.mtx" },
53-
{ 1, "karate.mtx" },
54-
{ 1, "ldbc-cdlp-undirected-example.mtx" },
55-
{ 1, "ldbc-undirected-example-bool.mtx" },
56-
{ 1, "ldbc-undirected-example-unweighted.mtx" },
57-
{ 1, "ldbc-undirected-example.mtx" },
58-
{ 1, "ldbc-wcc-example.mtx" },
59-
{ 0, "" },
51+
{ 2, 1, "A.mtx" },
52+
{ 60, 1, "jagmesh7.mtx" },
53+
{ 6, 0, "west0067.mtx" }, // unsymmetric
54+
{ 11, 1, "bcsstk13.mtx" },
55+
{ 5, 1, "karate.mtx" },
56+
{ 4, 1, "ldbc-cdlp-undirected-example.mtx" },
57+
{ 4, 1, "ldbc-undirected-example-bool.mtx" },
58+
{ 4, 1, "ldbc-undirected-example-unweighted.mtx" },
59+
{ 4, 1, "ldbc-undirected-example.mtx" },
60+
{ 3, 1, "ldbc-wcc-example.mtx" },
61+
{ 0, 0, "" },
6062
} ;
6163

6264
#undef OK
@@ -109,7 +111,9 @@ void test_diameter (void)
109111
OK (LAGraph_ExactDiameter (&diameter, &peripheral, &eccentricity,
110112
G, 8, msg)) ;
111113

112-
printf ("\ndiameter: %" PRIu64 "\n", diameter) ;
114+
printf ("\n%s exact diameter: %" PRIu64 "\n", aname, diameter) ;
115+
TEST_CHECK (diameter == files [k].diameter) ;
116+
113117
printf ("\nperipheral:\n") ;
114118
OK (LAGraph_Vector_Print (peripheral, pr, stdout, msg)) ;
115119
printf ("\neccentricity:\n") ;

0 commit comments

Comments
 (0)