From: Pavel Labath Date: Wed, 27 Oct 2021 10:47:11 +0000 (+0200) Subject: [lldb] Modernize TestVLA.py X-Git-Tag: upstream/15.0.7~27515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=560221ac7f5ca3d5dcae405587db066f4c4c8a7c;p=platform%2Fupstream%2Fllvm.git [lldb] Modernize TestVLA.py Use expect_expr/var_path instead of regular expect and substring checks --- diff --git a/lldb/test/API/lang/c/vla/TestVLA.py b/lldb/test/API/lang/c/vla/TestVLA.py index 215eadc..758406d 100644 --- a/lldb/test/API/lang/c/vla/TestVLA.py +++ b/lldb/test/API/lang/c/vla/TestVLA.py @@ -32,14 +32,19 @@ class TestVLA(TestBase): _, process, _, _ = lldbutil.run_to_source_breakpoint( self, "break here", lldb.SBFileSpec('main.c')) - def test(a, array): + def test(a): + children = [] for i in range(a): - self.expect("fr v vla[%d]"%i, substrs=["int", "%d"%(a-i)]) - self.expect("expr vla[%d]"%i, substrs=["int", "%d"%(a-i)]) - self.expect("fr v vla", substrs=array) + name = "[%d]"%i + value = str(a-i) + self.expect_var_path("vla"+name, type="int", value=value) + self.expect_expr("vla"+name, result_type="int", + result_value=value) + children.append(ValueCheck(name=name, value=value)) + self.expect_var_path("vla", type="int[]", children=children) self.expect("expr vla", error=True, substrs=["incomplete"]) - test(2, ["int[]", "[0] = 2, [1] = 1"]) + test(2) process.Continue() - test(4, ["int[]", "[0] = 4, [1] = 3, [2] = 2, [3] = 1"]) + test(4)