Back to index

enigmail  1.4.3
Public Member Functions
runtests.TypelibCompareMixin Class Reference
Inheritance diagram for runtests.TypelibCompareMixin:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def assertEqualTypelibs
def assertEqualInterfaces
def assertEqualMethods
def assertEqualConstants
def assertEqualParams
def assertEqualTypes

Detailed Description

Definition at line 85 of file runtests.py.


Member Function Documentation

def runtests.TypelibCompareMixin.assertEqualConstants (   self,
  c1,
  c2 
)

Definition at line 137 of file runtests.py.

00137 
00138     def assertEqualConstants(self, c1, c2):
00139         self.assert_(c1 is not None, "Should not be None")
00140         self.assert_(c2 is not None, "Should not be None")
00141         self.assertEqual(c1.name, c2.name)
00142         self.assertEqual(c1.value, c2.value)
00143         self.assertEqualTypes(c1.type, c2.type)

Here is the call graph for this function:

Here is the caller graph for this function:

def runtests.TypelibCompareMixin.assertEqualInterfaces (   self,
  i1,
  i2 
)

Definition at line 95 of file runtests.py.

00095 
00096     def assertEqualInterfaces(self, i1, i2):
00097         self.assert_(i1 is not None, "Should not be None")
00098         self.assert_(i2 is not None, "Should not be None")
00099         self.assertEqual(i1.name, i2.name, "Names should be equal")
00100         self.assertEqual(i1.iid, i2.iid, "IIDs should be equal")
00101         self.assertEqual(i1.namespace, i2.namespace,
00102                          "Namespaces should be equal")
00103         self.assertEqual(i1.resolved, i2.resolved,
00104                          "Resolved status should be equal")
00105         if i1.resolved:
00106             if i1.parent or i2.parent:
00107                 # Can't test exact equality, probably different objects
00108                 self.assertEqualInterfaces(i1.parent, i2.parent)
00109             self.assertEqual(len(i1.methods), len(i2.methods))
00110             for m, n in zip(i1.methods, i2.methods):
00111                 self.assertEqualMethods(m, n)
00112             self.assertEqual(len(i1.constants), len(i2.constants))
00113             for c, d in zip(i1.constants, i2.constants):
00114                 self.assertEqualConstants(c, d)
00115             self.assertEqual(i1.scriptable, i2.scriptable,
00116                              "Scriptable status should be equal")
00117             self.assertEqual(i1.function, i2.function,
00118                              "Function status should be equal")

Here is the call graph for this function:

Here is the caller graph for this function:

def runtests.TypelibCompareMixin.assertEqualMethods (   self,
  m1,
  m2 
)

Definition at line 119 of file runtests.py.

00119 
00120     def assertEqualMethods(self, m1, m2):
00121         self.assert_(m1 is not None, "Should not be None")
00122         self.assert_(m2 is not None, "Should not be None")
00123         self.assertEqual(m1.name, m2.name, "Names should be equal")
00124         self.assertEqual(m1.getter, m2.getter, "Getter flag should be equal")
00125         self.assertEqual(m1.setter, m2.setter, "Setter flag should be equal")
00126         self.assertEqual(m1.notxpcom, m2.notxpcom,
00127                          "notxpcom flag should be equal")
00128         self.assertEqual(m1.constructor, m2.constructor,
00129                          "constructor flag should be equal")
00130         self.assertEqual(m1.hidden, m2.hidden, "hidden flag should be equal")
00131         self.assertEqual(m1.optargc, m2.optargc, "optargc flag should be equal")
00132         self.assertEqual(m1.implicit_jscontext, m2.implicit_jscontext,
00133                          "implicit_jscontext flag should be equal")
00134         for p1, p2 in zip(m1.params, m2.params):
00135             self.assertEqualParams(p1, p2)
00136         self.assertEqualParams(m1.result, m2.result)
        

Here is the call graph for this function:

Here is the caller graph for this function:

def runtests.TypelibCompareMixin.assertEqualParams (   self,
  p1,
  p2 
)

Definition at line 144 of file runtests.py.

00144 
00145     def assertEqualParams(self, p1, p2):
00146         self.assert_(p1 is not None, "Should not be None")
00147         self.assert_(p2 is not None, "Should not be None")
00148         self.assertEqualTypes(p1.type, p2.type)
00149         self.assertEqual(p1.in_, p2.in_)
00150         self.assertEqual(p1.out, p2.out)
00151         self.assertEqual(p1.retval, p2.retval)
00152         self.assertEqual(p1.shared, p2.shared)
00153         self.assertEqual(p1.dipper, p2.dipper)
00154         self.assertEqual(p1.optional, p2.optional)
        

Here is the call graph for this function:

Here is the caller graph for this function:

def runtests.TypelibCompareMixin.assertEqualTypelibs (   self,
  t1,
  t2 
)

Definition at line 86 of file runtests.py.

00086 
00087     def assertEqualTypelibs(self, t1, t2):
00088         self.assert_(t1 is not None, "Should not be None")
00089         self.assert_(t2 is not None, "Should not be None")
00090         self.assertEqual(t1.version, t2.version, "Versions should be equal")
00091         self.assertEqual(len(t1.interfaces), len(t2.interfaces),
00092                          "Number of interfaces should be equal")
00093         for i, j in zip(t1.interfaces, t2.interfaces):
00094             self.assertEqualInterfaces(i, j)

Here is the call graph for this function:

Here is the caller graph for this function:

def runtests.TypelibCompareMixin.assertEqualTypes (   self,
  t1,
  t2 
)

Definition at line 155 of file runtests.py.

00155 
00156     def assertEqualTypes(self, t1, t2):
00157         self.assert_(t1 is not None, "Should not be None")
00158         self.assert_(t2 is not None, "Should not be None")
00159         self.assertEqual(type(t1), type(t2), "type types should be equal")
00160         self.assertEqual(t1.pointer, t2.pointer,
00161                          "pointer flag should be equal for %s and %s" % (t1, t2))
00162         self.assertEqual(t1.reference, t2.reference)
00163         if isinstance(t1, xpt.SimpleType):
00164             self.assertEqual(t1.tag, t2.tag)
00165         elif isinstance(t1, xpt.InterfaceType):
00166             self.assertEqualInterfaces(t1.iface, t2.iface)
00167         elif isinstance(t1, xpt.InterfaceIsType):
00168             self.assertEqual(t1.param_index, t2.param_index)
00169         elif isinstance(t1, xpt.ArrayType):
00170             self.assertEqualTypes(t1.element_type, t2.element_type)
00171             self.assertEqual(t1.size_is_arg_num, t2.size_is_arg_num)
00172             self.assertEqual(t1.length_is_arg_num, t2.length_is_arg_num)
00173         elif isinstance(t1, xpt.StringWithSizeType) or isinstance(t1, xpt.WideStringWithSizeType):
00174             self.assertEqual(t1.size_is_arg_num, t2.size_is_arg_num)
00175             self.assertEqual(t1.length_is_arg_num, t2.length_is_arg_num)
00176 
#TODO: test flags in various combinations

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: