1import lldb 2from lldbsuite.test.decorators import * 3from lldbsuite.test.lldbtest import * 4from lldbsuite.test import lldbutil 5 6class TestOperatorOverload(TestBase): 7 mydir = TestBase.compute_mydir(__file__) 8 9 def test_overload(self): 10 self.build() 11 (target, process, thread, 12 main_breakpoint) = lldbutil.run_to_source_breakpoint(self, 13 "break here", lldb.SBFileSpec("b.cpp")) 14 frame = thread.GetSelectedFrame() 15 value = frame.EvaluateExpression("x == nil") 16 self.assertTrue(str(value.GetError()) 17 .find("comparison between NULL and non-pointer ('Tinky' and NULL)") 18 != -1) 19 self.assertTrue(str(value.GetError()) 20 .find("invalid operands to binary expression ('Tinky' and") 21 != -1) 22 self.assertFalse(value.GetError().Success()) 23