]> granicus.if.org Git - graphviz/commitdiff
Add failing test case for #2225
authorMark Hansen <markhansen@google.com>
Fri, 8 Apr 2022 07:34:40 +0000 (17:34 +1000)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 5 May 2022 00:02:27 +0000 (17:02 -0700)
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 <matthew.fernandez@gmail.com>
rtest/2225.dot [new file with mode: 0644]
rtest/test_regression.py

diff --git a/rtest/2225.dot b/rtest/2225.dot
new file mode 100644 (file)
index 0000000..0caf571
--- /dev/null
@@ -0,0 +1,5 @@
+graph {
+       13 -- 24;
+       24 -- 49;
+       24 -- 13;
+}
index 197cfe1740a1eb97af4c43a285128b8a325f2837..aae323e4007fe8a64660c00186d09aaab00fce93 100644 (file)
@@ -1740,3 +1740,26 @@ def test_gvpr_usage():
   # the stderr output should have contained full usage instructions
   assert "-o <ofile> - write output to <ofile>; 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()