From: Magnus Jacobsson Date: Wed, 17 Aug 2022 10:52:20 +0000 (+0200) Subject: tests: SvgAnalyzer: add a graphvizEdge class X-Git-Tag: 6.0.1~32^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06c7ea4395339ff3c11ed7384c443a4b1e690000;p=graphviz tests: SvgAnalyzer: add a graphvizEdge class --- diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d82c47372..9f48cd86e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,6 +12,8 @@ enable_testing() # separate test can be as small as possible add_library(test_common SHARED catch2_main.cpp + graphviz_edge.cpp + graphviz_edge.h graphviz_node.h graphviz_node.cpp test_utilities.cpp diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp new file mode 100644 index 000000000..87800021c --- /dev/null +++ b/tests/graphviz_edge.cpp @@ -0,0 +1,8 @@ +#include "graphviz_edge.h" + +GraphvizEdge::GraphvizEdge(SVG::SVGElement &svg_g_element) + : m_svg_g_element(svg_g_element) {} + +const SVG::SVGElement &GraphvizEdge::svg_g_element() const { + return m_svg_g_element; +} diff --git a/tests/graphviz_edge.h b/tests/graphviz_edge.h new file mode 100644 index 000000000..fc83d3301 --- /dev/null +++ b/tests/graphviz_edge.h @@ -0,0 +1,22 @@ +#pragma once + +#include "svg_element.h" + +/** + * @brief The GraphvizEdge class represents a Graphviz edge according to the DOT + * language + */ + +class GraphvizEdge { +public: + GraphvizEdge() = delete; + explicit GraphvizEdge(SVG::SVGElement &svg_g_element); + + /// Return a non-mutable reference to the SVG `g` element corresponding to the + /// edge + const SVG::SVGElement &svg_g_element() const; + +private: + /// The SVG `g` element corresponding to the edge + SVG::SVGElement &m_svg_g_element; +};