]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/graph/example/graphviz.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / graph / example / graphviz.cpp
index 1d7fabac850f6ad23b59d83717f1f32b7b5e4385..5c6528976c04525b2ae9f3190bf7c847df157ae0 100644 (file)
@@ -7,7 +7,7 @@
 // Author: Douglas Gregor
 #include <boost/graph/graphviz.hpp>
 #include <boost/graph/adjacency_list.hpp>
-#include <boost/test/minimal.hpp>
+#include <boost/core/lightweight_test.hpp>
 #include <string>
 #include <fstream>
 #include <boost/graph/iteration_macros.hpp>
@@ -25,16 +25,18 @@ typedef boost::adjacency_list< vecS, vecS, undirectedS,
 void test_graph_read_write(const std::string& filename)
 {
     std::ifstream in(filename.c_str());
-    BOOST_REQUIRE(in);
+    if (!BOOST_TEST(in)) {
+        return;
+    }
 
     Graph g;
     dynamic_properties dp;
     dp.property("id", get(vertex_name, g));
     dp.property("weight", get(edge_weight, g));
-    BOOST_CHECK(read_graphviz(in, g, dp, "id"));
+    BOOST_TEST(read_graphviz(in, g, dp, "id"));
 
-    BOOST_CHECK(num_vertices(g) == 4);
-    BOOST_CHECK(num_edges(g) == 4);
+    BOOST_TEST(num_vertices(g) == 4);
+    BOOST_TEST(num_edges(g) == 4);
 
     typedef graph_traits< Graph >::vertex_descriptor Vertex;
 
@@ -43,27 +45,27 @@ void test_graph_read_write(const std::string& filename)
     name_to_vertex[get(vertex_name, g, v)] = v;
 
     // Check vertices
-    BOOST_CHECK(name_to_vertex.find("0") != name_to_vertex.end());
-    BOOST_CHECK(name_to_vertex.find("1") != name_to_vertex.end());
-    BOOST_CHECK(name_to_vertex.find("foo") != name_to_vertex.end());
-    BOOST_CHECK(name_to_vertex.find("bar") != name_to_vertex.end());
+    BOOST_TEST(name_to_vertex.find("0") != name_to_vertex.end());
+    BOOST_TEST(name_to_vertex.find("1") != name_to_vertex.end());
+    BOOST_TEST(name_to_vertex.find("foo") != name_to_vertex.end());
+    BOOST_TEST(name_to_vertex.find("bar") != name_to_vertex.end());
 
     // Check edges
-    BOOST_CHECK(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
-    BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
-    BOOST_CHECK(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
-    BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
+    BOOST_TEST(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
+    BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
+    BOOST_TEST(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
+    BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
 
-    BOOST_CHECK(get(edge_weight, g,
+    BOOST_TEST(get(edge_weight, g,
                     edge(name_to_vertex["0"], name_to_vertex["1"], g).first)
         == 3.14159);
-    BOOST_CHECK(get(edge_weight, g,
+    BOOST_TEST(get(edge_weight, g,
                     edge(name_to_vertex["1"], name_to_vertex["foo"], g).first)
         == 2.71828);
-    BOOST_CHECK(get(edge_weight, g,
+    BOOST_TEST(get(edge_weight, g,
                     edge(name_to_vertex["foo"], name_to_vertex["bar"], g).first)
         == 10.0);
-    BOOST_CHECK(get(edge_weight, g,
+    BOOST_TEST(get(edge_weight, g,
                     edge(name_to_vertex["1"], name_to_vertex["bar"], g).first)
         == 10.0);
 
@@ -71,9 +73,9 @@ void test_graph_read_write(const std::string& filename)
     write_graphviz_dp(std::cout, g, dp, std::string("id"));
 }
 
-int test_main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
     test_graph_read_write(argc >= 2 ? argv[1] : "graphviz_example.dot");
 
-    return 0;
+    return boost::report_errors();
 }