Add some tests

[SVN r33040]
This commit is contained in:
Douglas Gregor
2006-02-20 21:26:46 +00:00
parent af44a9cfa5
commit 0245e863c8
3 changed files with 14 additions and 10 deletions
+6 -2
View File
@@ -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) ]
+2 -2
View File
@@ -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,
+6 -6
View File
@@ -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