def test_resolve_type_None(self): with self.assertRaises(TypeError): resolved_type = resolve_type(None)
def test_resolve_type_by_str_bad(self): with self.assertRaises(MissingTypeError): resolved_type = resolve_type('unsigned long bad type')
def test_resolve_type_by_sym(self): sym = gdb.lookup_symbol("test_struct", None)[0] resolved_type = resolve_type(sym) self.assertTrue(sym.value().type == resolved_type)
def test_resolve_type_by_value(self): v = gdb.Value(10) resolved_type = resolve_type(v) self.assertTrue(v.type == resolved_type)
def test_resolve_type_by_str_good(self): t = gdb.lookup_type('unsigned long') resolved_type = resolve_type('unsigned long') self.assertTrue(t == resolved_type)
def test_resolve_type_None(self): with self.assertRaises(TypeError): resolved_type = resolve_type(None)
def test_resolve_type_by_sym(self): sym = gdb.lookup_symbol("test_struct", None)[0] resolved_type = resolve_type(sym) self.assertTrue(sym.value().type == resolved_type)
def test_resolve_type_by_str_bad(self): with self.assertRaises(MissingTypeError): resolved_type = resolve_type('unsigned long bad type')
def test_resolve_type_by_str_good(self): t = gdb.lookup_type('unsigned long') resolved_type = resolve_type('unsigned long') self.assertTrue(t == resolved_type)
def test_resolve_type_by_value(self): v = gdb.Value(10) resolved_type = resolve_type(v) self.assertTrue(v.type == resolved_type)