diff options
| author | Zachary Turner <zturner@google.com> | 2015-10-26 16:51:09 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-10-26 16:51:09 +0000 |
| commit | f67f7e31e7231c488d29a36b31c2725ad86acdb6 (patch) | |
| tree | 3f7cd03f40251f83822755b6cec09ad5d2301dec | |
| parent | 36b225913c746c9d965295666b599bd3d1690a17 (diff) | |
| download | bcm5719-llvm-f67f7e31e7231c488d29a36b31c2725ad86acdb6.tar.gz bcm5719-llvm-f67f7e31e7231c488d29a36b31c2725ad86acdb6.zip | |
Convert `long` to `int`, and portably detect all integral types.
llvm-svn: 251305
| -rw-r--r-- | lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py | 6 | ||||
| -rw-r--r-- | lldb/test/lang/c/array_types/TestArrayTypes.py | 2 | ||||
| -rw-r--r-- | lldb/test/lldbcurses.py | 5 | ||||
| -rw-r--r-- | lldb/test/python_api/sbdata/TestSBData.py | 4 | ||||
| -rw-r--r-- | lldb/test/tools/lldb-server/lldbgdbserverutils.py | 5 |
5 files changed, 13 insertions, 9 deletions
diff --git a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py index 3772e63d085..833229e06b0 100644 --- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py +++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py @@ -32,7 +32,7 @@ class CommonShortSpellingsTestCase(TestBase): ('ta st li', 'target stop-hook list'), ] - for (short, long) in abbrevs: - command_interpreter.ResolveCommand(short, result) + for (short_val, long_val) in abbrevs: + command_interpreter.ResolveCommand(short_val, result) self.assertTrue(result.Succeeded()) - self.assertEqual(long, result.GetOutput()) + self.assertEqual(long_val, result.GetOutput()) diff --git a/lldb/test/lang/c/array_types/TestArrayTypes.py b/lldb/test/lang/c/array_types/TestArrayTypes.py index 2d7d8a76096..f87f70ab4ae 100644 --- a/lldb/test/lang/c/array_types/TestArrayTypes.py +++ b/lldb/test/lang/c/array_types/TestArrayTypes.py @@ -182,7 +182,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'long_6' should have 6 children") child5 = variable.GetChildAtIndex(5) self.DebugSBValue(child5) - self.assertTrue(long(child5.GetValue(), 0) == 6, + self.assertTrue(int(child5.GetValue(), 0) == 6, "long_6[5] == 6") # Last, check that "long_6" has a value type of eValueTypeVariableLocal diff --git a/lldb/test/lldbcurses.py b/lldb/test/lldbcurses.py index 0f0351c4610..aeb4c46d814 100644 --- a/lldb/test/lldbcurses.py +++ b/lldb/test/lldbcurses.py @@ -1,5 +1,8 @@ +import lldb_shared + import curses, curses.panel import sys +import six import time class Point(object): @@ -138,7 +141,7 @@ class Window(object): for key in arg: self.add_key_action(key, callback, description) else: - if isinstance(arg, ( int, long )): + if isinstance(arg, six.integer_types): key_action_dict = { 'key' : arg, 'callback' : callback, 'description' : decription } diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py index b0c5be97d18..304e8abdbd4 100644 --- a/lldb/test/python_api/sbdata/TestSBData.py +++ b/lldb/test/python_api/sbdata/TestSBData.py @@ -220,8 +220,8 @@ class SBDataAPICase(TestBase): self.assertTrue(data2.uint8[4] == 111, 'o == 111') self.assert_data(data2.GetUnsignedInt8, 5, 33) # ! - uint_lists = [ [1,2,3,4,5], [long(i) for i in [1, 2, 3, 4, 5]] ] - int_lists = [ [2, -2], [long(i) for i in [2, -2]] ] + uint_lists = [ [1,2,3,4,5], [int(i) for i in [1, 2, 3, 4, 5]] ] + int_lists = [ [2, -2], [int(i) for i in [2, -2]] ] for l in uint_lists: data2 = lldb.SBData.CreateDataFromUInt64Array(process.GetByteOrder(), process.GetAddressByteSize(), l) diff --git a/lldb/test/tools/lldb-server/lldbgdbserverutils.py b/lldb/test/tools/lldb-server/lldbgdbserverutils.py index 11063148e45..a635878f5f2 100644 --- a/lldb/test/tools/lldb-server/lldbgdbserverutils.py +++ b/lldb/test/tools/lldb-server/lldbgdbserverutils.py @@ -9,6 +9,7 @@ import os import os.path import platform import re +import six import socket_packet_pump import subprocess import time @@ -808,8 +809,8 @@ def process_is_running(pid, unknown_value=True): If we don't know how to check running process ids on the given OS: return the value provided by the unknown_value arg. """ - if type(pid) not in [int, long]: - raise Exception("pid must be of type int (actual type: %s)" % str(type(pid))) + if not isinstance(pid, six.integer_types): + raise Exception("pid must be an integral type (actual type: %s)" % str(type(pid))) process_ids = [] |

