Beispiel #1
0
 def testProtectedCallWithInstanceCreatedOnCpp(self):
     '''Calls a non-virtual protected method on an instance created in C++.'''
     p = ProtectedNonPolymorphic.create()
     self.assertEqual(p.publicName(), p.protectedName())
     a0, a1 = 1, 2
     self.assertEqual(p.protectedSum(a0, a1), a0 + a1)
Beispiel #2
0
 def testProtectedCall(self):
     '''Calls a non-virtual protected method.'''
     p = ProtectedNonPolymorphic('NonPoly')
     self.assertEqual(p.publicName(), p.protectedName())
     a0, a1 = 1, 2
     self.assertEqual(p.protectedSum(a0, a1), a0 + a1)
Beispiel #3
0
 def testModifiedProtectedCall(self):
     '''Calls a non-virtual protected method modified with code injection.'''
     p = ProtectedNonPolymorphic('NonPoly')
     self.assertEqual(p.dataTypeName(), 'integer')
     self.assertEqual(p.dataTypeName(1), 'integer')
     self.assertEqual(p.dataTypeName(Point(1, 2)), 'pointer')
Beispiel #4
0
 def testModifiedProtectedCall(self):
     '''Calls a non-virtual protected method modified with code injection.'''
     p = ProtectedNonPolymorphic('NonPoly')
     self.assertEqual(p.dataTypeName(), 'integer')
     self.assertEqual(p.dataTypeName(1), 'integer')
     self.assertEqual(p.dataTypeName(Point(1, 2)), 'pointer')
Beispiel #5
0
 def testProtectedCallWithInstanceCreatedOnCpp(self):
     '''Calls a non-virtual protected method on an instance created in C++.'''
     p = ProtectedNonPolymorphic.create()
     self.assertEqual(p.publicName(), p.protectedName())
     a0, a1 = 1, 2
     self.assertEqual(p.protectedSum(a0, a1), a0 + a1)
Beispiel #6
0
 def testProtectedCall(self):
     '''Calls a non-virtual protected method.'''
     p = ProtectedNonPolymorphic('NonPoly')
     self.assertEqual(p.publicName(), p.protectedName())
     a0, a1 = 1, 2
     self.assertEqual(p.protectedSum(a0, a1), a0 + a1)