]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/graph/test/test_graphs.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / graph / test / test_graphs.cpp
index 2f0965238b3c5d07a01f736ebfb02a20d62a19ee..81c489bb56043a7da6810a80602e9ae73c73739c 100644 (file)
@@ -24,178 +24,185 @@ using namespace boost;
 
 int main()
 {
-  // Bootstrap all of the tests by declaring a kind graph and  asserting some
-  // basic properties about it.
-  {
-    typedef undirected_graph<VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_undirected_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_mutable_graph<Graph>);
-    BOOST_META_ASSERT(is_mutable_property_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
-  {
-    typedef directed_graph<VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_directed_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_mutable_graph<Graph>);
-    BOOST_META_ASSERT(is_mutable_property_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
-  {
-    typedef adjacency_list<vecS, vecS, undirectedS, VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_undirected_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_add_only_property_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
-  {
-    typedef adjacency_list<vecS, vecS, directedS, VertexBundle, EdgeBundle, GraphBundle> Graph;
-    Graph g;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(!is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_directed_unidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_add_only_property_graph<Graph>);
-    test_graph(g);
-  }
-  {
-    // Common bidi adjlist
-    typedef adjacency_list<vecS, vecS, bidirectionalS, VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_directed_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_add_only_property_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
-  {
-    // Same as above, but testing VL==listS
-    typedef adjacency_list<vecS, listS, bidirectionalS, VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_directed_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_mutable_property_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
-  {
-    typedef adjacency_matrix<directedS, VertexBundle, EdgeBundle, GraphBundle> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(!is_multigraph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_mutable_edge_graph<Graph>);
-    BOOST_META_ASSERT(is_mutable_edge_property_graph<Graph>);
-    Graph g(N);
-    test_graph(g);
-  }
-  {
-    typedef adjacency_matrix<directedS, VertexBundle, EdgeBundle> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(!is_multigraph<Graph>);
-    BOOST_META_ASSERT(has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_mutable_edge_graph<Graph>);
-    BOOST_META_ASSERT(is_mutable_edge_property_graph<Graph>);
-    Graph g(N);
-    test_graph(g);
-  }
-  {
-    typedef labeled_graph<directed_graph<>, unsigned> Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(is_incidence_graph<Graph>);
-    BOOST_META_ASSERT(is_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_directed_bidirectional_graph<Graph>);
-    BOOST_META_ASSERT(is_labeled_mutable_property_graph<Graph>);
-    BOOST_META_ASSERT(is_labeled_graph<Graph>);
-    BOOST_META_ASSERT(!has_vertex_property<Graph>);
-    BOOST_META_ASSERT(!has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(!has_edge_property<Graph>);
-    BOOST_META_ASSERT(!has_bundled_edge_property<Graph>);
-    BOOST_META_ASSERT(is_labeled_mutable_graph<Graph>);
-    Graph g;
-    test_graph(g);
-  }
+    // Bootstrap all of the tests by declaring a kind graph and  asserting some
+    // basic properties about it.
+    {
+        typedef undirected_graph< VertexBundle, EdgeBundle, GraphBundle > Graph;
+        BOOST_META_ASSERT(is_undirected_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_mutable_graph< Graph >);
+        BOOST_META_ASSERT(is_mutable_property_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
+    {
+        typedef directed_graph< VertexBundle, EdgeBundle, GraphBundle > Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_directed_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_mutable_graph< Graph >);
+        BOOST_META_ASSERT(is_mutable_property_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
+    {
+        typedef adjacency_list< vecS, vecS, undirectedS, VertexBundle,
+            EdgeBundle, GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_undirected_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_add_only_property_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
+    {
+        typedef adjacency_list< vecS, vecS, directedS, VertexBundle, EdgeBundle,
+            GraphBundle >
+            Graph;
+        Graph g;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(!is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_directed_unidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_add_only_property_graph< Graph >);
+        test_graph(g);
+    }
+    {
+        // Common bidi adjlist
+        typedef adjacency_list< vecS, vecS, bidirectionalS, VertexBundle,
+            EdgeBundle, GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_directed_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_add_only_property_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
+    {
+        // Same as above, but testing VL==listS
+        typedef adjacency_list< vecS, listS, bidirectionalS, VertexBundle,
+            EdgeBundle, GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_directed_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_mutable_property_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
+    {
+        typedef adjacency_matrix< directedS, VertexBundle, EdgeBundle,
+            GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(!is_multigraph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_mutable_edge_graph< Graph >);
+        BOOST_META_ASSERT(is_mutable_edge_property_graph< Graph >);
+        Graph g(N);
+        test_graph(g);
+    }
+    {
+        typedef adjacency_matrix< directedS, VertexBundle, EdgeBundle > Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(!is_multigraph< Graph >);
+        BOOST_META_ASSERT(has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_mutable_edge_graph< Graph >);
+        BOOST_META_ASSERT(is_mutable_edge_property_graph< Graph >);
+        Graph g(N);
+        test_graph(g);
+    }
+    {
+        typedef labeled_graph< directed_graph<>, unsigned > Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(is_incidence_graph< Graph >);
+        BOOST_META_ASSERT(is_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_directed_bidirectional_graph< Graph >);
+        BOOST_META_ASSERT(is_labeled_mutable_property_graph< Graph >);
+        BOOST_META_ASSERT(is_labeled_graph< Graph >);
+        BOOST_META_ASSERT(!has_vertex_property< Graph >);
+        BOOST_META_ASSERT(!has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(!has_edge_property< Graph >);
+        BOOST_META_ASSERT(!has_bundled_edge_property< Graph >);
+        BOOST_META_ASSERT(is_labeled_mutable_graph< Graph >);
+        Graph g;
+        test_graph(g);
+    }
 
-  // FIXME: CSR doesn't have mutability traits so we can't generalize the
-  // constructions of the required graph. Just assert the properties for now.
-  // NOTE: CSR graphs are also atypical in that they don't have "normal"
-  // vertex and edge properties. They're "abnormal" in the sense that they have
-  // a valid bundled type, but the property types are no_property.
-  {
-    typedef compressed_sparse_row_graph<
-      directedS, VertexBundle, EdgeBundle, GraphBundle
-    > Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(has_graph_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_graph_property<Graph>);
-    BOOST_META_ASSERT(!has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(!has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-  }
-  {
-    typedef compressed_sparse_row_graph<
-      bidirectionalS, VertexBundle, EdgeBundle, GraphBundle
-    > Graph;
-    BOOST_META_ASSERT(is_directed_graph<Graph>);
-    BOOST_META_ASSERT(is_multigraph<Graph>);
-    BOOST_META_ASSERT(has_graph_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_graph_property<Graph>);
-    BOOST_META_ASSERT(!has_vertex_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_vertex_property<Graph>);
-    BOOST_META_ASSERT(!has_edge_property<Graph>);
-    BOOST_META_ASSERT(has_bundled_edge_property<Graph>);
-  }
-
-
-  // TODO: What other kinds of graphs do we have here...
+    // FIXME: CSR doesn't have mutability traits so we can't generalize the
+    // constructions of the required graph. Just assert the properties for now.
+    // NOTE: CSR graphs are also atypical in that they don't have "normal"
+    // vertex and edge properties. They're "abnormal" in the sense that they
+    // have a valid bundled type, but the property types are no_property.
+    {
+        typedef compressed_sparse_row_graph< directedS, VertexBundle,
+            EdgeBundle, GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(has_graph_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_graph_property< Graph >);
+        BOOST_META_ASSERT(!has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(!has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+    }
+    {
+        typedef compressed_sparse_row_graph< bidirectionalS, VertexBundle,
+            EdgeBundle, GraphBundle >
+            Graph;
+        BOOST_META_ASSERT(is_directed_graph< Graph >);
+        BOOST_META_ASSERT(is_multigraph< Graph >);
+        BOOST_META_ASSERT(has_graph_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_graph_property< Graph >);
+        BOOST_META_ASSERT(!has_vertex_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_vertex_property< Graph >);
+        BOOST_META_ASSERT(!has_edge_property< Graph >);
+        BOOST_META_ASSERT(has_bundled_edge_property< Graph >);
+    }
 
+    // TODO: What other kinds of graphs do we have here...
 }
-