[lldb][NFC] Cleanup TestFixIts.py
authorRaphael Isemann <teemperor@gmail.com>
Mon, 30 Mar 2020 07:19:59 +0000 (09:19 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 30 Mar 2020 07:40:03 +0000 (09:40 +0200)
lldb/test/API/commands/expression/fixits/TestFixIts.py

index 7aca1c5..1e8e7dd 100644 (file)
@@ -2,8 +2,6 @@
 Test calling an expression with errors that a FixIt can fix.
 """
 
-
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
@@ -14,19 +12,6 @@ class ExprCommandWithFixits(TestBase):
 
     mydir = TestBase.compute_mydir(__file__)
 
-    def setUp(self):
-        # Call super's setUp().
-        TestBase.setUp(self)
-
-        self.main_source = "main.cpp"
-        self.main_source_spec = lldb.SBFileSpec(self.main_source)
-
-    @skipUnlessDarwin
-    def test_with_target(self):
-        """Test calling expressions with errors that can be fixed by the FixIts."""
-        self.build()
-        self.try_expressions()
-
     def test_with_dummy_target(self):
         """Test calling expressions in the dummy target with errors that can be fixed by the FixIts."""
 
@@ -38,10 +23,13 @@ class ExprCommandWithFixits(TestBase):
         self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "The expression was successful.")
         self.assertTrue("Fix-it applied" in ret_val.GetError(), "Found the applied FixIt.")
 
-    def try_expressions(self):
+    @skipUnlessDarwin
+    def test_with_target(self):
         """Test calling expressions with errors that can be fixed by the FixIts."""
+        self.build()
         (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
-                                        'Stop here to evaluate expressions', self.main_source_spec)
+                                        'Stop here to evaluate expressions',
+                                         lldb.SBFileSpec("main.cpp"))
 
         options = lldb.SBExpressionOptions()
         options.SetAutoApplyFixIts(True)