Lines Matching refs:self
87 def __init__(self): argument
91 self.tests = set()
93 def get_expected(self): argument
97 all_tests = sorted(self.tests)
100 def add_test(self, ty): argument
104 self.tests.add(Func(ty))
106 def get_name(self): argument
112 def __str__(self): argument
116 all_tests = sorted(self.tests)
122 test_invoke += self.TEST_GROUP_INVOKE_TEMPLATE.format(test_name=t.get_name())
123 main_func = self.MAIN_FUNCTION_TEMPLATE.format(test_group_invoke=test_invoke)
125 return self.MAIN_CLASS_TEMPLATE.format(copyright = get_copyright("smali"),
216 def __init__(self, farg): argument
220 self.farg = farg
222 def get_expected(self): argument
226 exp = self.farg.get_called()
228 return self.NSME_RESULT_TEMPLATE.format(tree = self.farg.get_tree())
230 return self.AME_RESULT_TEMPLATE.format(tree = self.farg.get_tree())
232 return self.ICCE_RESULT_TEMPLATE.format(tree = self.farg.get_tree())
235 return self.NORMAL_RESULT_TEMPLATE.format(tree = self.farg.get_tree(),
238 def get_name(self): argument
242 return "TEST_FUNC_{}".format(self.farg.get_name())
244 def __str__(self): argument
248 return self.TEST_FUNCTION_TEMPLATE.format(tree = self.farg.get_tree(),
249 fname = self.get_name(),
250 farg = self.farg.get_name())
276 def __init__(self, iface): argument
280 self.iface = iface
281 self.class_name = "CLASS_"+gensym()
283 def get_name(self): argument
287 return self.class_name
289 def get_tree(self): argument
293 return "[{class_name} {iface_tree}]".format(class_name = self.class_name,
294 iface_tree = self.iface.get_tree())
296 def __iter__(self): argument
300 yield self.iface
301 yield from self.iface
303 def get_called(self): argument
308 return self.iface.get_called()
310 def __str__(self): argument
314 return self.TEST_CLASS_TEMPLATE.format(copyright = get_copyright('smali'),
315 iface_name = self.iface.get_name(),
316 tree = self.get_tree(),
317 class_name = self.class_name,
332 def get_suffix(self): argument
333 if self == InterfaceType.default:
335 elif self == InterfaceType.abstract:
337 elif self == InterfaceType.empty:
347 def is_conflict(self): argument
354 def is_abstract(self): argument
361 def is_empty(self): argument
368 def is_default(self): argument
417 def __init__(self, ifaces, iface_type, full_name = None): argument
421 self.ifaces = sorted(ifaces)
422 self.iface_type = iface_type
424 end = self.iface_type.get_suffix()
425 self.class_name = "INTERFACE_"+gensym()+end
427 self.class_name = full_name
429 def get_specific_version(self, v): argument
433 return TestInterface(self.ifaces, v, full_name = self.class_name)
435 def get_super_types(self): argument
439 return set(i2 for i2 in self)
441 def is_conflict(self): argument
448 def is_abstract(self): argument
453 return self.iface_type == InterfaceType.abstract
455 def is_empty(self): argument
460 return self.iface_type == InterfaceType.empty
462 def is_default(self): argument
467 return self.iface_type == InterfaceType.default
469 def get_called(self): argument
474 if not self.is_empty() or len(self.ifaces) == 0:
475 return self
477 best = self
478 for super_iface in self.ifaces:
493 def get_name(self): argument
497 return self.class_name
499 def get_tree(self): argument
503 return "[{class_name} {iftree}]".format(class_name = self.get_name(),
504 iftree = print_tree(self.ifaces))
506 def __iter__(self): argument
511 for i in self.ifaces:
515 def __str__(self): argument
521 for i in self.ifaces:
522 s_ifaces += self.IMPLEMENTS_TEMPLATE.format(iface_name = i.get_name())
525 if self.is_default():
526 funcs = self.DEFAULT_FUNC_TEMPLATE.format(tree = self.get_tree())
527 elif self.is_abstract():
528 funcs = self.ABSTRACT_FUNC_TEMPLATE.format()
531 return self.TEST_INTERFACE_TEMPLATE.format(copyright = get_copyright('smali'),
533 extends = "extends" if len(self.ifaces) else "",
536 tree = self.get_tree(),
537 class_name = self.class_name)