]> granicus.if.org Git - graphviz/commitdiff
add new test_edge_node_overlap_point_node_shape test
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Fri, 16 Sep 2022 10:32:13 +0000 (12:32 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Thu, 22 Sep 2022 08:21:14 +0000 (10:21 +0200)
An upcoming commit series will add separate fixes for different parts
of the overlap problems. Having separate test cases for checking
maximum or minimum overlap will make it easier to see that the fixes
have the intended effect.

tests/CMakeLists.txt
tests/test_edge_node_overlap_point_node_shape.cpp [new file with mode: 0644]

index 38f3aeb5b67b839324fec8151441575efd187ddd..285d8b4b28b9b1e874de4cae84c5a82d10f32d10 100644 (file)
@@ -94,6 +94,7 @@ CREATE_TEST(edge_node_overlap_all_primitive_edge_arrows)
 CREATE_TEST(edge_node_overlap_ellipse_node_shapes_except_point)
 CREATE_TEST(edge_node_overlap_normal_and_inv_edge_arrows)
 CREATE_TEST(edge_node_overlap_normal_and_inv_edge_arrows_all_modifiers)
+CREATE_TEST(edge_node_overlap_point_node_shape)
 CREATE_TEST(edge_node_overlap_polygon_node_shapes)
 CREATE_TEST(edge_node_overlap_simple)
 CREATE_TEST(max_edge_node_overlap_simple)
diff --git a/tests/test_edge_node_overlap_point_node_shape.cpp b/tests/test_edge_node_overlap_point_node_shape.cpp
new file mode 100644 (file)
index 0000000..fe31aaf
--- /dev/null
@@ -0,0 +1,30 @@
+#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 point node shape",
+          "[!shouldfail] Test that an edge connected to a 'point' shaped node "
+          "touches that node and does not overlap it too much") {
+
+  const auto shape = "point";
+  INFO(fmt::format("Node shape: {}", shape));
+
+  const auto rankdir = GENERATE(from_range(all_rank_directions));
+  INFO(fmt::format("Rank direction: {}", rankdir));
+
+  const graph_options graph_options = {
+      .rankdir = rankdir,
+      .node_shape = shape,
+      .node_penwidth = 2,
+      .edge_penwidth = 2,
+  };
+
+  const auto filename_base = AUTO_NAME();
+
+  test_edge_node_overlap(graph_options, {}, {.filename_base = filename_base});
+}