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"),
181 def __init__(self, farg): argument
185 self.farg = farg
187 def get_expected(self): argument
191 return "\n".join(self.farg.get_expected())
193 def get_name(self): argument
197 return "TEST_FUNC_{}".format(self.farg.get_name())
199 def __str__(self): argument
203 return self.TEST_FUNCTION_TEMPLATE.format(fname = self.get_name(),
204 farg = self.farg.get_name())
215 def get_output_format(self): argument
216 if self == InterfaceCallResponse.NoError:
218 elif self == InterfaceCallResponse.AbstractMethodError:
220 elif self == InterfaceCallResponse.NoSuchMethodError:
321 def __init__(self, ifaces): argument
325 self.ifaces = ifaces
326 self.class_name = "CLASS_"+gensym()
328 def get_name(self): argument
332 return self.class_name
334 def get_tree(self): argument
338 return "[{class_name} {iface_tree}]".format(class_name = self.class_name,
339 iface_tree = print_tree(self.ifaces))
341 def __iter__(self): argument
345 for i in self.ifaces:
349 def get_expected(self): argument
350 for iface in self.ifaces:
351 yield self.OUTPUT_PREFIX.format(iface_name = iface.get_name(), tree = self.get_tree())
354 tree = self.get_tree())
356 def __str__(self): argument
360 s_ifaces = '\n'.join(map(lambda a: self.IMPLEMENTS_TEMPLATE.format(iface_name = a.get_name()),
361 self.ifaces))
362 j_ifaces = ', '.join(map(lambda a: a.get_name(), self.ifaces))
363 super_template = self.SUPER_CALL_TEMPLATE
365 class_name = self.get_name(),
366 tree = self.get_tree()) for iface in self.ifaces)
367 return self.TEST_CLASS_TEMPLATE.format(copyright = get_copyright('smali'),
370 tree = self.get_tree(),
371 class_name = self.class_name,
386 def get_suffix(self): argument
387 if self == InterfaceType.default:
389 elif self == InterfaceType.abstract:
391 elif self == InterfaceType.empty:
401 def is_conflict(self): argument
408 def is_abstract(self): argument
415 def is_empty(self): argument
422 def is_default(self): argument
429 def get_response(self): argument
479 def __init__(self, ifaces, iface_type, full_name = None): argument
483 self.ifaces = sorted(ifaces)
484 self.iface_type = iface_type
486 end = self.iface_type.get_suffix()
487 self.class_name = "INTERFACE_"+gensym()+end
489 self.class_name = full_name
491 def get_specific_version(self, v): argument
495 return TestInterface(self.ifaces, v, full_name = self.class_name)
497 def get_super_types(self): argument
501 return set(i2 for i2 in self)
503 def is_conflict(self): argument
510 def is_abstract(self): argument
515 return self.iface_type == InterfaceType.abstract
517 def is_empty(self): argument
522 return self.iface_type == InterfaceType.empty
524 def is_default(self): argument
529 return self.iface_type == InterfaceType.default
531 def get_expected(self): argument
532 response = self.get_response()
534 for iface in self.ifaces:
535 if self.is_default():
536 yield self.OUTPUT_PREFIX.format(iface_name = iface.get_name(), tree = self.get_tree())
538 if self.is_default():
540 tree = self.get_tree())
542 def get_response(self): argument
543 if self.is_default():
545 elif self.is_abstract():
547 elif len(self.ifaces) == 0:
550 return self.get_called().get_response()
552 def get_called(self): argument
557 if not self.is_empty() or len(self.ifaces) == 0:
558 return self
560 best = self
561 for super_iface in self.ifaces:
576 def get_name(self): argument
580 return self.class_name
582 def get_tree(self): argument
586 return "[{class_name} {iftree}]".format(class_name = self.get_name(),
587 iftree = print_tree(self.ifaces))
589 def __iter__(self): argument
594 for i in self.ifaces:
598 def __str__(self): argument
602 s_ifaces = '\n'.join(map(lambda a: self.IMPLEMENTS_TEMPLATE.format(iface_name = a.get_name()),
603 self.ifaces))
604 j_ifaces = ', '.join(map(lambda a: a.get_name(), self.ifaces))
605 if self.is_default():
606 super_template = self.SUPER_CALL_TEMPLATE
608 class_name = self.get_name(),
609 tree = self.get_tree()) for iface in self.ifaces)
610 funcs = self.DEFAULT_FUNC_TEMPLATE.format(super_calls = super_calls)
611 elif self.is_abstract():
612 funcs = self.ABSTRACT_FUNC_TEMPLATE.format()
615 return self.TEST_INTERFACE_TEMPLATE.format(copyright = get_copyright('smali'),
617 extends = "extends" if len(self.ifaces) else "",
620 tree = self.get_tree(),
621 class_name = self.class_name)