-
-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
Arch commands test module | ||
""" | ||
|
||
from tests.base import RemoteGefUnitTestGeneric | ||
from tests.utils import ( | ||
ARCH, | ||
ERROR_INACTIVE_SESSION_MESSAGE, | ||
debug_target, | ||
findlines, | ||
is_32b, | ||
is_64b, | ||
) | ||
|
||
|
||
class ArchCommand(RemoteGefUnitTestGeneric): | ||
"""Generic class for command testing, that defines all helpers""" | ||
|
||
def setUp(self) -> None: | ||
return super().setUp() | ||
|
||
def test_cmd_arch_get(self): | ||
gdb = self._gdb | ||
|
||
res = gdb.execute("arch get", to_string=True) | ||
self.assertIn(" Architecture(Generic, None, LITTLE_ENDIAN)", res) | ||
self.assertIn(" This default architecture", res) | ||
|
||
def test_cmd_arch_set(self): | ||
gdb = self._gdb | ||
|
||
res = gdb.execute("arch get", to_string=True) | ||
self.assertIn(" Architecture(Generic, None, LITTLE_ENDIAN)", res) | ||
self.assertIn(" This default architecture", res) | ||
|
||
gdb.execute("arch set X86") | ||
|
||
res = gdb.execute("arch get", to_string=True) | ||
self.assertIn(" Architecture(Generic, None, LITTLE_ENDIAN)", res) | ||
self.assertIn(" The architecture has been set manually", res) | ||
|
||
def test_cmd_arch_list(self): | ||
gdb = self._gdb | ||
|
||
res = gdb.execute("arch list", to_string=True) | ||
self.assertIn("- GenericArchitecture", res) | ||
self.assertIn("- X86", res) | ||
self.assertIn("- X86_64", res) |