From cabd430cd19cf93f23e14c7560d811618487aa74 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Wed, 7 Jul 2021 15:56:05 +0200 Subject: [PATCH] add test of multiple GVLayout constructions of the same graph using different contexts passed as rvalue refs --- tests/test_GVLayout_construction.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_GVLayout_construction.cpp b/tests/test_GVLayout_construction.cpp index 4f3ffa063..146ea7559 100644 --- a/tests/test_GVLayout_construction.cpp +++ b/tests/test_GVLayout_construction.cpp @@ -136,6 +136,19 @@ TEST_CASE("Layout of multiple graphs can use the same context and pass the " const auto layout2 = GVC::GVLayout(gvc, std::move(g2), "dot"); } +TEST_CASE("Multiple layouts of the same graph can use different contexts " + "passed as rvalue refs") { + const auto demand_loading = false; + auto gvc1 = GVC::GVContext(lt_preloaded_symbols, demand_loading); + auto dot = "graph {}"; + auto g = std::make_shared(dot); + + const auto layout1 = GVC::GVLayout(std::move(gvc1), g, "dot"); + + auto gvc2 = GVC::GVContext(lt_preloaded_symbols, demand_loading); + const auto layout2 = GVC::GVLayout(std::move(gvc2), g, "dot"); +} + TEST_CASE("Layout with an unknown engine throws an exception") { auto dot = "digraph {}"; auto g = std::make_shared(dot); -- 2.40.0