]> granicus.if.org Git - graphviz/commitdiff
add test of multiple GVLayout constructions of different graphs passed as rvalue...
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 7 Jul 2021 13:36:51 +0000 (15:36 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 7 Aug 2021 09:08:54 +0000 (11:08 +0200)
tests/test_GVLayout_construction.cpp

index fda27a53f26c428ac96417fea3b6a8dbd94c9d93..4f3ffa06357ef820f938f15f43d2f26b6a0a7eca 100644 (file)
@@ -119,6 +119,23 @@ TEST_CASE("Layout of a graph can use built-in plugins and pass the context and "
   const auto layout = GVC::GVLayout(std::move(gvc), std::move(g), "dot");
 }
 
+TEST_CASE("Layout of multiple graphs can use the same context and pass the "
+          "graphs as rvalue refs") {
+  const auto demand_loading = false;
+  auto gvc = std::make_shared<GVC::GVContext>(
+      GVC::GVContext(lt_preloaded_symbols, demand_loading));
+
+  auto dot1 = "graph {}";
+  auto g1 = CGraph::AGraph(dot1);
+
+  const auto layout1 = GVC::GVLayout(gvc, std::move(g1), "dot");
+
+  auto dot2 = "graph {}";
+  auto g2 = CGraph::AGraph(dot2);
+
+  const auto layout2 = GVC::GVLayout(gvc, std::move(g2), "dot");
+}
+
 TEST_CASE("Layout with an unknown engine throws an exception") {
   auto dot = "digraph {}";
   auto g = std::make_shared<CGraph::AGraph>(dot);