]> granicus.if.org Git - graphviz/commitdiff
add new test_edge_node_overlap_all_node_shapes test
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 14 Sep 2022 20:13:37 +0000 (22:13 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 20 Sep 2022 15:53:06 +0000 (17:53 +0200)
tests/CMakeLists.txt
tests/test_edge_node_overlap_all_node_shapes.cpp [new file with mode: 0644]

index 4b09c3f8e51d426765b0640e82dd817099fc9393..1efc556be74dabfa52ee0bc88d3b13f66a29e784 100644 (file)
@@ -88,6 +88,7 @@ CREATE_TEST(GVContext_construction)
 CREATE_TEST(GVContext_render_svg)
 CREATE_TEST(GVLayout_construction)
 CREATE_TEST(GVLayout_render)
+CREATE_TEST(edge_node_overlap_all_node_shapes)
 CREATE_TEST(edge_node_overlap_simple)
 CREATE_TEST(max_edge_node_overlap_simple)
 CREATE_TEST(min_edge_node_overlap_simple)
diff --git a/tests/test_edge_node_overlap_all_node_shapes.cpp b/tests/test_edge_node_overlap_all_node_shapes.cpp
new file mode 100644 (file)
index 0000000..9444215
--- /dev/null
@@ -0,0 +1,27 @@
+#include <iostream>
+#include <string>
+
+#include <catch2/catch.hpp>
+#include <fmt/format.h>
+
+#include "test_edge_node_overlap_utilities.h"
+#include "test_utilities.h"
+
+TEST_CASE(
+    "Overlap all node shapes",
+    "[!shouldfail] Test that an edge connected to a node touches that node and "
+    "does not overlap it too much, regardless of the node shape") {
+
+  const auto shape = GENERATE(from_range(all_node_shapes));
+  INFO(fmt::format("Node shape: {}", shape));
+
+  const graph_options graph_options = {
+      .node_shape = shape,
+      .node_penwidth = 2,
+      .edge_penwidth = 2,
+  };
+
+  const auto filename_base = fmt::format("{}_{}", AUTO_NAME(), shape);
+
+  test_edge_node_overlap(graph_options, {}, {.filename_base = filename_base});
+}