[Lldb-commits] [lldb] 450073c - Change the patterns to include the prefix '= ' so we don't pass errantly.

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 6 15:20:22 PST 2020


Author: Jason Molenda
Date: 2020-01-06T15:20:13-08:00
New Revision: 450073c639d7f182e48ec8b1b588212194089a52

URL: https://github.com/llvm/llvm-project/commit/450073c639d7f182e48ec8b1b588212194089a52
DIFF: https://github.com/llvm/llvm-project/commit/450073c639d7f182e48ec8b1b588212194089a52.diff

LOG: Change the patterns to include the prefix '= ' so we don't pass errantly.
Looking at a sometimes-passing test case on a platform
where random values were being returned - sometimes
the expected digit ('1' or '2') would be included in the
random returned value.  Add a prefix to reduce the likelihood of
this a bit.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py
index 2ad0c313d601..57987c8cb364 100644
--- a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py
+++ b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py
@@ -40,10 +40,10 @@ def test_call_on_base(self):
 
         # Test call to method in base class (this should always work as the base
         # class method is never an override).
-        self.expect("expr b->foo()", substrs=["2"])
+        self.expect("expr b->foo()", substrs=["= 2"])
 
         # Test calling the base class.
-        self.expect("expr realbase.foo()", substrs=["1"])
+        self.expect("expr realbase.foo()", substrs=["= 1"])
 
     @skipIfLinux # Returns wrong result code on some platforms.
     def test_call_on_derived(self):
@@ -61,7 +61,7 @@ def test_call_on_derived(self):
         # Test call to overridden method in derived class (this will fail if the
         # overrides table is not correctly set up, as Derived::foo will be assigned
         # a vtable entry that does not exist in the compiled program).
-        self.expect("expr d.foo()", substrs=["2"])
+        self.expect("expr d.foo()", substrs=["= 2"])
 
     @skipIf(oslist=["linux"], archs=["aarch64"])
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr43707")
@@ -78,5 +78,5 @@ def test_call_on_temporary(self):
         self.runCmd("run", RUN_SUCCEEDED)
 
         # Test with locally constructed instances.
-        self.expect("expr Base().foo()", substrs=["1"])
-        self.expect("expr Derived().foo()", substrs=["2"])
+        self.expect("expr Base().foo()", substrs=["= 1"])
+        self.expect("expr Derived().foo()", substrs=["= 2"])


        


More information about the lldb-commits mailing list