Пример #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)
Пример #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)
Пример #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')
Пример #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')
Пример #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)
Пример #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)