]> granicus.if.org Git - graphviz/commitdiff
add test of GVLayout construction overload, passing the context and the graph as...
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 7 Jul 2021 12:17:43 +0000 (14:17 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 7 Aug 2021 09:08:53 +0000 (11:08 +0200)
tests/test_GVLayout_construction.cpp

index 09446a22fd7f608f169ed8aa27f922f00d3130d4..fda27a53f26c428ac96417fea3b6a8dbd94c9d93 100644 (file)
@@ -98,6 +98,27 @@ TEST_CASE("Creating a second layout for the same graph without destroying the "
   REQUIRE_THROWS_AS(GVC::GVLayout(gvc2, g, "dot"), std::runtime_error);
 }
 
+TEST_CASE("Layout of a graph can use on-demand loaded plugins and pass the "
+          "context and the graph as rvalue refs)") {
+  auto gvc = GVC::GVContext();
+
+  auto dot = "graph {}";
+  auto g = CGraph::AGraph(dot);
+
+  const auto layout = GVC::GVLayout(std::move(gvc), std::move(g), "dot");
+}
+
+TEST_CASE("Layout of a graph can use built-in plugins and pass the context and "
+          "the graph as rvalue refs)") {
+  const auto demand_loading = false;
+  auto gvc = GVC::GVContext(lt_preloaded_symbols, demand_loading);
+
+  auto dot = "graph {}";
+  auto g = CGraph::AGraph(dot);
+
+  const auto layout = GVC::GVLayout(std::move(gvc), std::move(g), "dot");
+}
+
 TEST_CASE("Layout with an unknown engine throws an exception") {
   auto dot = "digraph {}";
   auto g = std::make_shared<CGraph::AGraph>(dot);