]> granicus.if.org Git - graphviz/commitdiff
fix: remove Circo test of root.gv from rtest.py-tested graphs
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 28 Dec 2020 03:13:58 +0000 (19:13 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 23 Jan 2021 23:16:50 +0000 (15:16 -0800)
This graph generates an overflow when computing the area of rectangles required
to layout it out. It should be rejected but it currently incorrectly is not.
Related to #1906.

rtest/test_regression.py
rtest/tests.txt
rtest/tests_subset.txt

index 086eb97a2fadf703e137475585d0af9d0700a10a..fa9f249cedc0552d0e0e8d9c3f74927b0e9ff829 100644 (file)
@@ -559,6 +559,27 @@ def test_1869(variant: int):
     assert 'style=dashed' in output, 'style=dashed not found in DOT output'
     assert 'penwidth=2' in output, 'penwidth=2 not found in DOT output'
 
+@pytest.mark.xfail(strict=True) # FIXME
+def test_1906():
+    '''
+    graphs that cause an overflow during rectangle calculation should result in
+    a layout error
+    https://gitlab.com/graphviz/graphviz/-/issues/1906
+    '''
+
+    # one of the rtest graphs is sufficient to provoke this
+    input = os.path.join(os.path.dirname(__file__), 'graphs/root.gv')
+    assert os.path.exists(input), 'unexpectedly missing test case'
+
+    # use Circo to translate it to DOT
+    p = subprocess.Popen(['dot', '-Kcirco', '-Tgv', '-o', os.devnull, input],
+      stderr=subprocess.PIPE, universal_newlines=True)
+    _, stderr = p.communicate()
+
+    assert p.returncode != 0, 'graph that generates overflow was accepted'
+
+    assert 'area too large' in stderr, 'missing/incorrect error message'
+
 @pytest.mark.skipif(shutil.which('twopi') is None, reason='twopi not available')
 def test_1907():
     '''
index 3aac85351dc9789b5e286cc50df6912ec314c066..f14172b40fba269bb015824d83181b7a8d3b9e43 100644 (file)
@@ -260,7 +260,6 @@ dot gv
 root
 =
 twopi gv
-circo gv
 
 cairo
 =
index ca0661a6a777f994df63e1761d88b8f22dcf5f73..6be29266a60547cbc91d860c07e3cf4a13e3499a 100644 (file)
@@ -260,7 +260,6 @@ dot gv
 #root
 #=
 #twopi gv
-#circo gv
 
 #cairo
 #=