Skip to content

Commit 7e425be

Browse files
committed
[lldb][test] Fix duplicate error messages in expect_expr/var_path
The error message field for expect_* methods always prints the value object, so there is no need to specify a custom error message that then just prints the object too. This fixes the duplicate value object printout on test failures.
1 parent da17c1c commit 7e425be

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def __init__(
292292
self.children = children
293293
self.dereference = dereference
294294

295-
def check_value(self, test_base, val, error_msg=None):
295+
def check_value(self, test_base, val, error_msg=""):
296296
"""
297297
Checks that the given value matches the currently set properties
298298
of this ValueCheck. If a match failed, the given TestBase will
@@ -335,7 +335,7 @@ def check_value(self, test_base, val, error_msg=None):
335335
if self.dereference is not None:
336336
self.dereference.check_value(test_base, val.Dereference(), error_msg)
337337

338-
def check_value_children(self, test_base, val, error_msg=None):
338+
def check_value_children(self, test_base, val, error_msg=""):
339339
"""
340340
Checks that the children of a SBValue match a certain structure and
341341
have certain properties.
@@ -2923,7 +2923,7 @@ def expect_expr(
29232923
summary=result_summary,
29242924
children=result_children,
29252925
)
2926-
value_check.check_value(self, eval_result, str(eval_result))
2926+
value_check.check_value(self, eval_result)
29272927
return eval_result
29282928

29292929
def expect_var_path(
@@ -2950,7 +2950,7 @@ def expect_var_path(
29502950
value_check = ValueCheck(
29512951
type=type, value=value, summary=summary, children=children
29522952
)
2953-
value_check.check_value(self, eval_result, str(eval_result))
2953+
value_check.check_value(self, eval_result)
29542954
return eval_result
29552955

29562956
"""Assert that an lldb.SBError is in the "success" state."""

0 commit comments

Comments
 (0)