From: Mark Hansen Date: Fri, 8 Apr 2022 07:34:40 +0000 (+1000) Subject: Add failing test case for #2225 X-Git-Tag: 4.0.0~50^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77646425d61f6a4e62845df2f0366198adaa3233;p=graphviz Add failing test case for #2225 This fails when I run ``` pytest test_regression.py -k test_2225 ``` on macOS. I manually reduced the test case to minimal format, starting from `graphs/undirected/ngk10_4.gv` and removing unnecessary elements. Co-authored-by: Matthew Fernandez --- diff --git a/rtest/2225.dot b/rtest/2225.dot new file mode 100644 index 000000000..0caf57160 --- /dev/null +++ b/rtest/2225.dot @@ -0,0 +1,5 @@ +graph { + 13 -- 24; + 24 -- 49; + 24 -- 13; +} diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 197cfe174..aae323e40 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -1740,3 +1740,26 @@ def test_gvpr_usage(): # the stderr output should have contained full usage instructions assert "-o - write output to ; stdout by default" in stderr, \ "truncated or malformed GVPR usage information" + +@pytest.mark.xfail() # FIXME +def test_2225(): + """ + sfdp should not segfault with curved splines + https://gitlab.com/graphviz/graphviz/-/issues/2225 + """ + + # locate our associated test case in this directory + input = Path(__file__).parent / "2225.dot" + assert input.exists(), "unexpectedly missing test case" + + # run this through sfdp + p = subprocess.run(["sfdp", "-Gsplines=curved", "-o", os.devnull, input], + stderr=subprocess.PIPE, universal_newlines=True) + + # if sfdp was built without libgts, it will not handle anything non-trivial + no_gts_error = "remove_overlap: Graphviz not built with triangulation library" + if no_gts_error in p.stderr: + assert p.returncode != 0, "sfdp returned success after an error message" + return + + p.check_returncode()