Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / gdb / change_variable.py
index c87f95f..72b6d0d 100644 (file)
@@ -3,24 +3,25 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-from gdb_test import AssertEquals
 import gdb_test
 
 
-def test(gdb):
-  gdb.Command('break test_change_variable')
-  gdb.ResumeAndExpectStop('continue', 'breakpoint-hit')
-  gdb.Command('set var arg = 2')
-  AssertEquals(gdb.Eval('arg'), '2')
-  gdb.ResumeCommand('step')
-  AssertEquals(gdb.Eval('local_var'), '4')
-  gdb.Command('set var local_var = 5')
-  AssertEquals(gdb.Eval('local_var'), '5')
-  gdb.Command('set var global_var = 1')
-  AssertEquals(gdb.Eval('global_var'), '1')
-  gdb.ResumeCommand('step')
-  AssertEquals(gdb.Eval('global_var'), '8') # 1 + 5 + 2
+class ChangeVariableTest(gdb_test.GdbTest):
+
+  def test_change_variable(self):
+    self.gdb.Command('break test_change_variable')
+    self.gdb.ResumeAndExpectStop('continue', 'breakpoint-hit')
+    self.gdb.Command('set var arg = 2')
+    self.assertEquals(self.gdb.Eval('arg'), '2')
+    self.gdb.ResumeCommand('step')
+    self.assertEquals(self.gdb.Eval('local_var'), '4')
+    self.gdb.Command('set var local_var = 5')
+    self.assertEquals(self.gdb.Eval('local_var'), '5')
+    self.gdb.Command('set var global_var = 1')
+    self.assertEquals(self.gdb.Eval('global_var'), '1')
+    self.gdb.ResumeCommand('step')
+    self.assertEquals(self.gdb.Eval('global_var'), '8') # 1 + 5 + 2
 
 
 if __name__ == '__main__':
-  gdb_test.RunTest(test, 'change_variable')
+  gdb_test.Main()