Skip to content

Commit

Permalink
[lldb] Remove unused and too strict error_msg parameter from expect_expr
Browse files Browse the repository at this point in the history
Directly matching the error message is nearly never useful. We can re-add
error-checking once we have a plan to properly implement this.
  • Loading branch information
Teemperor committed Mar 12, 2020
1 parent 461566b commit af7fc8c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Expand Up @@ -2396,15 +2396,13 @@ def expect_expr(
result_summary=None,
result_value=None,
result_type=None,
error_msg=None,
):
"""
Evaluates the given expression and verifies the result.
:param expr: The expression as a string.
:param result_summary: The summary that the expression should have. None if the summary should not be checked.
:param result_value: The value that the expression should have. None if the value should not be checked.
:param result_type: The type that the expression result should have. None if the type should not be checked.
:param error_msg: The error message the expression should return. None if the error output should not be checked.
"""
self.assertTrue(expr.strip() == expr, "Expression contains trailing/leading whitespace: '" + expr + "'")

Expand All @@ -2420,11 +2418,6 @@ def expect_expr(

eval_result = frame.EvaluateExpression(expr, options)

if error_msg:
self.assertFalse(eval_result.IsValid(), "Unexpected success with result: '" + str(eval_result) + "'")
self.assertEqual(error_msg, eval_result.GetError().GetCString())
return

if not eval_result.GetError().Success():
self.assertTrue(eval_result.GetError().Success(),
"Unexpected failure with msg: " + eval_result.GetError().GetCString())
Expand Down

0 comments on commit af7fc8c

Please sign in to comment.