From: Magnus Jacobsson Date: Wed, 14 Sep 2022 13:19:59 +0000 (+0200) Subject: add new test_max_edge_node_overlap_polygon_node_shapes test X-Git-Tag: 6.0.2~34^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=038ab71b9bff4e921c09565e4ea8229fe22355c7;p=graphviz add new test_max_edge_node_overlap_polygon_node_shapes 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. --- diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 82a6a208f..dedfcf1df 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -92,6 +92,7 @@ CREATE_TEST(edge_node_overlap_all_node_shapes) CREATE_TEST(edge_node_overlap_polygon_node_shapes) CREATE_TEST(edge_node_overlap_simple) CREATE_TEST(max_edge_node_overlap_simple) +CREATE_TEST(max_edge_node_overlap_polygon_node_shapes) CREATE_TEST(min_edge_node_overlap_simple) CREATE_TEST(neatopack) CREATE_TEST(node_color) diff --git a/tests/test_max_edge_node_overlap_polygon_node_shapes.cpp b/tests/test_max_edge_node_overlap_polygon_node_shapes.cpp new file mode 100644 index 000000000..bb42b1c0c --- /dev/null +++ b/tests/test_max_edge_node_overlap_polygon_node_shapes.cpp @@ -0,0 +1,31 @@ +#include +#include + +#include "test_edge_node_overlap_utilities.h" +#include "test_utilities.h" + +TEST_CASE( + "Maximum edge and node overlap for polygon node shapes", + "[!shouldfail] Test that an edge connected to a polygon based node does " + "not overlap that node, regardless of the node shape") { + + const auto shape = GENERATE(from_range(node_shapes_consisting_of_polygon)); + INFO(fmt::format("Node shape: {}", shape)); + + const graph_options graph_options = { + .node_shape = shape, + .node_penwidth = 2, + .edge_penwidth = 2, + }; + + const tc_check_options check_options = { + .check_max_edge_node_overlap = true, + .check_min_edge_node_overlap = false, + }; + + const auto filename_base = + fmt::format("test_edge_node_overlap_polygon_node_shape_{}", shape); + + test_edge_node_overlap(graph_options, check_options, + {.filename_base = filename_base}); +}