From bf5e5834d91ff89f77a53c96cb468600c33cb111 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Wed, 25 Sep 2019 07:11:37 +0000 Subject: [lldb][NFC] Refactor TestCallBuiltinFunction Using asserts doesn't print a useful error message in case this test fails. llvm-svn: 372815 --- .../expression/call-function/TestCallBuiltinFunction.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py') diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py b/lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py index 87787f3479a..0065d98f473 100644 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py @@ -40,14 +40,7 @@ class ExprCommandCallBuiltinFunction(TestBase): # Test different builtin functions. - interp.HandleCommand("expr __builtin_isinf(0.0f)", result) - self.assertEqual(result.GetOutput(), "(int) $0 = 0\n") - - interp.HandleCommand("expr __builtin_isnormal(0.0f)", result) - self.assertEqual(result.GetOutput(), "(int) $1 = 0\n") - - interp.HandleCommand("expr __builtin_constant_p(1)", result) - self.assertEqual(result.GetOutput(), "(int) $2 = 1\n") - - interp.HandleCommand("expr __builtin_abs(-14)", result) - self.assertEqual(result.GetOutput(), "(int) $3 = 14\n") + self.expect("expr __builtin_isinf(0.0f)", substrs=["(int) $", " = 0\n"]) + self.expect("expr __builtin_isnormal(0.0f)", substrs=["(int) $", " = 0\n"]) + self.expect("expr __builtin_constant_p(1)", substrs=["(int) $", " = 1\n"]) + self.expect("expr __builtin_abs(-14)", substrs=["(int) $", " = 14\n"]) -- cgit v1.2.3