[Lldb-commits] [lldb] r372815 - [lldb][NFC] Refactor TestCallBuiltinFunction

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 25 00:11:38 PDT 2019


Author: teemperor
Date: Wed Sep 25 00:11:37 2019
New Revision: 372815

URL: http://llvm.org/viewvc/llvm-project?rev=372815&view=rev
Log:
[lldb][NFC] Refactor TestCallBuiltinFunction

Using asserts doesn't print a useful error message in case this test fails.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py?rev=372815&r1=372814&r2=372815&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallBuiltinFunction.py Wed Sep 25 00:11:37 2019
@@ -40,14 +40,7 @@ class ExprCommandCallBuiltinFunction(Tes
 
         # 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"])




More information about the lldb-commits mailing list