From 3d43a134e7d44f2f083e05323e96f60e4f61e003 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Wed, 7 Jul 2021 14:17:43 +0200 Subject: [PATCH] add test of GVLayout construction overload, passing the context and the graph as rvalue refs --- tests/test_GVLayout_construction.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_GVLayout_construction.cpp b/tests/test_GVLayout_construction.cpp index 09446a22f..fda27a53f 100644 --- a/tests/test_GVLayout_construction.cpp +++ b/tests/test_GVLayout_construction.cpp @@ -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(dot); -- 2.40.0