-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtest_types_module.py
More file actions
30 lines (24 loc) · 934 Bytes
/
test_types_module.py
File metadata and controls
30 lines (24 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
import unittest
import gdb
gdbinit = """
set build-id-verbose 0
set python print-stack full
set prompt py-crash>
set height 0
set print pretty on"""
class TestModules(unittest.TestCase):
def test_for_each_module(self):
from crash.types.module import for_each_module
modtype = gdb.lookup_type('struct module')
for mod in for_each_module():
self.assertTrue(mod.type == modtype)
def test_for_each_module_section(self):
from crash.types.module import for_each_module_section
from crash.types.module import for_each_module
for mod in for_each_module():
for section in for_each_module_section(mod):
self.assertTrue(type(section) is tuple)
self.assertTrue(type(section[0]) is str)
self.assertTrue(type(section[1]) is int)