mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-23 01:33:06 +00:00
d3c9e24115
The majority of test cases already inherited from drgn's TestCase class. The few outliers that inherited directly from unittest.TestCase have been brought in line with the other tests. Signed-off-by: Kevin Svetlitski <svetlitski@fb.com>
22 lines
678 B
Python
22 lines
678 B
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
import itertools
|
|
|
|
from drgn import Architecture, Platform, PlatformFlags
|
|
from tests import TestCase
|
|
|
|
|
|
class TestPlatform(TestCase):
|
|
def test_default_flags(self):
|
|
Platform(Architecture.X86_64)
|
|
self.assertRaises(ValueError, Platform, Architecture.UNKNOWN)
|
|
|
|
def test_registers(self):
|
|
self.assertIn(
|
|
"rax",
|
|
itertools.chain.from_iterable(
|
|
reg.names for reg in Platform(Architecture.X86_64).registers
|
|
),
|
|
)
|
|
self.assertEqual(Platform(Architecture.UNKNOWN, PlatformFlags(0)).registers, ())
|