Update of /cvsroot/boost/boost/libs/graph/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31505
Modified Files:
graphviz_test.cpp
Log Message:
Fixed up the testing for graph names.
Index: graphviz_test.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/graph/test/graphviz_test.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- graphviz_test.cpp 20 Jun 2007 16:28:50 -0000 1.7
+++ graphviz_test.cpp 21 Jun 2007 16:12:05 -0000 1.8
@@ -46,9 +46,7 @@
bool test_graph(std::istream& dotfile, mass_map_t const& masses,
weight_map_t const& weights,
std::string const& node_id = "node_id",
- std::string* g_name_ptr = NULL) {
- std::string dummy;
- if (!g_name_ptr) g_name_ptr = &dummy;
+ std::string const& g_name = std::string()) {
typedef property < vertex_name_t, std::string,
property < vertex_color_t, float > > vertex_p;
@@ -118,6 +116,10 @@
BOOST_CHECK_CLOSE(edge_weight, ref_weight, 0.01);
}
}
+ if(!g_name.empty()) {
+ std::string parsed_name = get_property(graph,graph_name);
+ BOOST_CHECK(parsed_name == g_name);
+ }
} else {
@@ -216,15 +218,26 @@
BOOST_CHECK((test_graph<directedS,vecS>(gs,mass_map_t(),weights)));
}
- // Graph Property Test
+ // Graph Property Test 1
{
mass_map_t masses;
insert ( masses ) ("a",0.0f) ("c",0.0f) ("e", 6.66f);
gs_t gs("digraph { graph [name=\"foo\"] a c e [mass = 6.66] }");
- std::string graph_name;
+ std::string graph_name("foo");
BOOST_CHECK((test_graph<directedS,vecS>(gs,masses,weight_map_t(),"",
- &graph_name)));
+ graph_name)));
+ }
+
+ // Graph Property Test 2
+ {
+ mass_map_t masses;
+ insert ( masses ) ("a",0.0f) ("c",0.0f) ("e", 6.66f);
+ gs_t gs("digraph { name=\"foo\" a c e [mass = 6.66] }");
+ std::string graph_name("foo");
+ BOOST_CHECK((test_graph<directedS,vecS>(gs,masses,weight_map_t(),"",
+ graph_name)));
}
+
// Comments embedded in strings
{
gs_t gs(
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs