From a914ad05aa08e8255fb16d1c32f289375f9e91ce Mon Sep 17 00:00:00 2001 From: Rob Hart Date: Thu, 3 Dec 2020 02:45:41 -0800 Subject: [PATCH] Add regression test for issue 1898 --- rtest/1898.dot | 57 ++++++++++++++++++++++++++++++++++++++++ rtest/test_regression.py | 14 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 rtest/1898.dot diff --git a/rtest/1898.dot b/rtest/1898.dot new file mode 100644 index 000000000..ca980b35a --- /dev/null +++ b/rtest/1898.dot @@ -0,0 +1,57 @@ +digraph G { +newrank = true +graph [label=< + +
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz:yyyyyy * range:1
llllll
>, labelloc="t", fontsize=20] +N1 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=2] +N2 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=2] +N12 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N16 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=2] +N17 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N18 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N19 [label="multi-line-label\nabcde\n1234567\r" shape="point", fillcolor="#FFFFFF", style="invisible", width=0, peripheries=1] +N26 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N30 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N31 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N36 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N40 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N41 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N48 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N52 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N53 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N54 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=2] +N55 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N56 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N66 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N70 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N74 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#F15854", style="filled", width=1, peripheries=1] +N78 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=1] +N79 [label="multi-line-label\nabcde\n1234567\r" shape="box", fillcolor="#FFFFFF", style="filled", width=1, peripheries=2] +N1 -> N12 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N2 -> N40 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N12 -> N19 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N16 -> N17 [label="multi-line-label\nabcde\n1234567\r" headlabel="1"] +N17 -> N18 [label="multi-line-label\nabcde\n1234567\r"] +N18 -> N26 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N19 -> N17 [label="multi-line-label\nabcde\n1234567\r" headlabel="0"] +N19 -> N55 [label="multi-line-label\nabcde\n1234567\r" headlabel="0", penwidth=5] +N26 -> N30 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N30 -> N31 [label="multi-line-label\nabcde\n1234567\r"] +N31 -> N36 [label="multi-line-label\nabcde\n1234567\r" taillabel="0", penwidth=5] +N31 -> N41 [label="multi-line-label\nabcde\n1234567\r" headlabel="1", taillabel="0", penwidth=5] +N36 -> N41 [label="single-line-label", headlabel="0", penwidth=5] +N40 -> N41 [label="multi-line-label\nabcde\n1234567\r" headlabel="2"] +N41 -> N48 [label="single-line-label", taillabel="0", penwidth=5] +N41 -> N52 [label="single-line-label", headlabel="0", taillabel="0", penwidth=5] +N48 -> N52 [label="single-line-label", headlabel="1", penwidth=5] +N52 -> N53 [label="single-line-label"] +N52 -> N78 [label="single-line-label", headlabel="0", penwidth=5] +N53 -> N56 [label="single-line-label", headlabel="1"] +N54 -> N55 [label="multi-line-label\nabcde\n1234567\r" headlabel="1"] +N55 -> N56 [label="multi-line-label\nabcde\n1234567\r" headlabel="0"] +N56 -> N66 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N66 -> N70 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N70 -> N74 [label="multi-line-label\nabcde\n1234567\r" penwidth=5] +N74 -> N78 [label="single-line-label", headlabel="1", penwidth=5] +N78 -> N79 [label="single-line-label"] +} diff --git a/rtest/test_regression.py b/rtest/test_regression.py index c1f6fa993..fda365bef 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -433,6 +433,20 @@ def test_1865(): # fdp should not crash when processing this file subprocess.check_call(['fdp', '-o', os.devnull, input]) +def test_1898(): + ''' + test a segfault from https://gitlab.com/graphviz/graphviz/-/issues/1898 has + not reappeared + ''' + + # locate our associated test case in this directory + input = os.path.join(os.path.dirname(__file__), '1898.dot') + assert os.path.exists(input), 'unexpectedly missing test case' + + # ask Graphviz to process it, which should generate a segfault if this bug + # has been reintroduced + subprocess.check_call(['dot', '-Tsvg', '-o', os.devnull, input]) + # root directory of this checkout ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) -- 2.40.0