From c7a0411857ea627c2a943881d266759e61a219c6 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 21 Apr 2022 21:51:59 -0700 Subject: [PATCH] tests: adjust #2092 test case to expect failure Even when this is fixed to not crash, it should still not exit with success because the input it is given is invalid. Unfortunately we need to also adjust the xfail condition to be non-strict because this passes under ASan, due to exiting with 1 when an invalid memory reference is detected. Gitlab: #2092 --- rtest/test_regression.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 6fb1f6a83..09f693748 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -1228,14 +1228,18 @@ def test_2089_2(): @pytest.mark.skipif(shutil.which("dot2gxl") is None, reason="dot2gxl not available") -@pytest.mark.xfail(strict=True) # FIXME +@pytest.mark.xfail() # FIXME def test_2092(): """ an empty node ID should not cause a dot2gxl NULL pointer dereference https://gitlab.com/graphviz/graphviz/-/issues/2092 """ - subprocess.run(["dot2gxl", "-d"], input='', check=True, - universal_newlines=True) + p = subprocess.run(["dot2gxl", "-d"], input='', + universal_newlines=True) + + assert p.returncode != 0, "dot2gxl accepted invalid input" + + assert p.returncode == 1, "dot2gxl crashed" @pytest.mark.skipif(os.environ.get("build_system") == "msbuild" and os.environ.get("configuration") == "Debug", -- 2.40.0