1 | #define BOOST_TEST_DYN_LINK
|
---|
2 | #define BOOST_TEST_MODULE MyTest
|
---|
3 | #include <boost/test/unit_test.hpp>
|
---|
4 |
|
---|
5 | #include <cassert>
|
---|
6 | #include <iostream>
|
---|
7 |
|
---|
8 | #include <boost/graph/adjacency_iterator.hpp>
|
---|
9 | #include <boost/graph/random.hpp>
|
---|
10 | #include <boost/random/linear_congruential.hpp>
|
---|
11 |
|
---|
12 | using namespace std;
|
---|
13 | using namespace boost;
|
---|
14 | using namespace boost::random;
|
---|
15 |
|
---|
16 | typedef adjacency_list<vecS, vecS, undirectedS> Graph;
|
---|
17 |
|
---|
18 | BOOST_AUTO_TEST_CASE(my_test)
|
---|
19 | {
|
---|
20 | for (int n = 20; n <= 30; ++n)
|
---|
21 | for (int e = 10; e <= 20; ++e)
|
---|
22 | for (int s = 1; s <= 100; ++s)
|
---|
23 | {
|
---|
24 | Graph g;
|
---|
25 | minstd_rand gen;
|
---|
26 | gen.seed(s);
|
---|
27 | generate_random_graph(g, n, e, gen, false);
|
---|
28 |
|
---|
29 | // Remove the whitespace below. I had put the whitespace there
|
---|
30 | // because Trac thought the file is spam, and blocked it.
|
---|
31 | BOOST_CHECK_MESS AGE(num_edges(g) == e,
|
---|
32 | "n = " << n << ", e = " << e << ", s = " << s
|
---|
33 | << ", but got " << num_edges(g) << " edges");
|
---|
34 | }
|
---|
35 | }
|
---|