From 2e7519201c4c1abd0db3d91b1895d983e45f4662 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 16 Sep 2022 11:07:38 +0200 Subject: [PATCH] add new test_edge_node_overlap_ellipse_node_shapes_except_point test 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 | 1 + ...erlap_ellipse_node_shapes_except_point.cpp | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/test_edge_node_overlap_ellipse_node_shapes_except_point.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5b237e180..38f3aeb5b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -91,6 +91,7 @@ CREATE_TEST(GVLayout_render) CREATE_TEST(edge_node_overlap_all_edge_arrows) CREATE_TEST(edge_node_overlap_all_node_shapes) 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_polygon_node_shapes) diff --git a/tests/test_edge_node_overlap_ellipse_node_shapes_except_point.cpp b/tests/test_edge_node_overlap_ellipse_node_shapes_except_point.cpp new file mode 100644 index 000000000..eb2ab7739 --- /dev/null +++ b/tests/test_edge_node_overlap_ellipse_node_shapes_except_point.cpp @@ -0,0 +1,34 @@ +#include +#include + +#include +#include + +#include "test_edge_node_overlap_utilities.h" +#include "test_utilities.h" + +TEST_CASE("Overlap ellipse node shapes", + "[!shouldfail] Test that an edge connected to an ellipse based node " + "touches that node and does not overlap it too much, regardless of " + "the node shape") { + + const auto shape = GENERATE_COPY( + filter([](const std::string_view shape) { return shape != "point"; }, + from_range(node_shapes_consisting_of_ellipse))); + + 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 = fmt::format("{}_{}", AUTO_NAME(), shape); + + test_edge_node_overlap(graph_options, {}, {.filename_base = filename_base}); +} -- 2.40.0