mirror of
https://github.com/boostorg/graph.git
synced 2026-07-21 13:23:42 +00:00
Add some tests
[SVN r33040]
This commit is contained in:
+6
-2
@@ -21,8 +21,6 @@ local rule turn-off-intel-debug-symbols ( toolset variant : properties * )
|
||||
|
||||
test-suite graph :
|
||||
|
||||
[ run transitive_closure_test.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
[ compile adj_list_cc.cpp : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
# adj_list_test needs some work -JGS
|
||||
@@ -37,6 +35,10 @@ test-suite graph :
|
||||
|
||||
[ run betweenness_centrality_test.cpp ]
|
||||
|
||||
[ run bidir_remove_edge.cpp ]
|
||||
|
||||
[ run bidir_vec_remove_edge.cpp ]
|
||||
|
||||
[ run csr_graph_test.cpp : : : : : release ]
|
||||
|
||||
[ run dag_longest_paths.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
@@ -73,6 +75,8 @@ test-suite graph :
|
||||
|
||||
[ run subgraph.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
[ run transitive_closure_test.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
[ run isomorphism.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
[ run adjacency_matrix_test.cpp : : : <sysinclude>$(BOOST_ROOT) ]
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#include <iostream>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/cstdlib.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/test/minimal.hpp>
|
||||
|
||||
struct edge_prop {
|
||||
int weight;
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
test_main(int, char*[])
|
||||
{
|
||||
{
|
||||
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS,
|
||||
|
||||
@@ -28,17 +28,17 @@ test_main(int, char*[])
|
||||
|
||||
edge e1 = boost::edge(0, 1, g).first;
|
||||
edge e2 = boost::edge(1, 0, g).first;
|
||||
BOOST_TEST( num_edges(g) == 2 );
|
||||
BOOST_TEST( g[e1].weight == 42 );
|
||||
BOOST_TEST( g[e2].weight == 17 );
|
||||
BOOST_CHECK( num_edges(g) == 2 );
|
||||
BOOST_CHECK( g[e1].weight == 42 );
|
||||
BOOST_CHECK( g[e2].weight == 17 );
|
||||
remove_edge(e1, g);
|
||||
BOOST_TEST( num_edges(g) == 1 );
|
||||
BOOST_CHECK( num_edges(g) == 1 );
|
||||
|
||||
// e2 has been invalidated, so grab it again
|
||||
bool b2;
|
||||
tie(e2, b2) = boost::edge(1, 0, g);
|
||||
BOOST_TEST( b2 );
|
||||
BOOST_TEST( g[e2].weight == 17 );
|
||||
BOOST_CHECK( b2 );
|
||||
BOOST_CHECK( g[e2].weight == 17 );
|
||||
|
||||
/* Now remove the other edge. Here, the fact that
|
||||
* stored_ra_edge_iterator keeps an index but does not update it
|
||||
|
||||
Reference in New Issue
Block a user