]> granicus.if.org Git - graphviz/commitdiff
add a test case for #1408
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 16:53:25 +0000 (09:53 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 03:57:06 +0000 (20:57 -0700)
rtest/1408.dot [new file with mode: 0644]
rtest/test_regression.py

diff --git a/rtest/1408.dot b/rtest/1408.dot
new file mode 100644 (file)
index 0000000..18032af
--- /dev/null
@@ -0,0 +1,31 @@
+digraph map {
+    splines=ortho;
+    layout="dot";
+    rankdir="LR";
+
+    # Clusters
+    subgraph "cluster_1" {
+        node [style=filled];
+        style=filled;
+
+        label="Cluster 1";
+        color="pink";
+
+        #Nodes
+        "node1" [fillcolor=red,shape=house]
+    }
+    subgraph "cluster_2" {
+        node [style=filled];
+        style=filled;
+
+        label="Cluster 2";
+        color="lightblue";
+
+        #Nodes:
+        "node2" [fillcolor=red,shape=box3d]
+    }
+
+
+    # Edges
+    "node2" -> "node1" [color=red,arrowhead=dot]
+}
index b134e89622130e496579260b7f0c40f92846c6ba..5c50b7e734054964514c78ad094e88b169e04223 100644 (file)
@@ -15,6 +15,17 @@ import pytest
 sys.path.append(os.path.dirname(__file__))
 from gvtest import ROOT, run_c #pylint: disable=C0413
 
+def is_ndebug_defined() -> bool:
+  """
+  are assertions disabled in the Graphviz build under test?
+  """
+
+  # the Windows release builds set NDEBUG
+  if os.environ.get("configuration") == "Release":
+    return True
+
+  return False
+
 # The terminology used in rtest.py is a little inconsistent. At the
 # end it reports the total number of tests, the number of "failures"
 # (crashes) and the number of "changes" (which is the number of tests
@@ -219,6 +230,20 @@ def test_1314():
   # the execution did not fail as expected
   pytest.fail("dot incorrectly exited with success")
 
+@pytest.mark.xfail(strict=not is_ndebug_defined()) # FIXME
+def test_1408():
+  """
+  parsing particular ortho layouts should not cause an assertion failure
+  https://gitlab.com/graphviz/graphviz/-/issues/1408
+  """
+
+  # locate our associated test case in this directory
+  input = Path(__file__).parent / "1408.dot"
+  assert input.exists(), "unexpectedly missing test case"
+
+  # process it with Graphviz
+  subprocess.check_call(["dot", "-Tsvg", "-o", os.devnull, input])
+
 def test_1411():
   """
   parsing strings containing newlines should not disrupt line number tracking