Example #1
0
 def testPassingExtendsNoImplicitConversionAsNoImplicitConversionByReference(
         self):
     '''Gives an ExtendsNoImplicitConversion object to a function expecting a NoImplicitConversion, passing by reference.'''
     obj = ExtendsNoImplicitConversion(123)
     self.assertEqual(
         obj.objId(),
         NoImplicitConversion.receivesNoImplicitConversionByReference(obj))
Example #2
0
 def testPassingExtendsNoImplicitConversionAsNoImplicitConversionByPointer(
         self):
     '''Gives an ExtendsNoImplicitConversion object to a function expecting a NoImplicitConversion, passing by pointer.
        This should not be accepted, since pointers should not be converted.'''
     obj = ExtendsNoImplicitConversion(123)
     self.assertRaises(
         TypeError,
         NoImplicitConversion.receivesNoImplicitConversionByPointer, obj)
 def testPassingExtendsNoImplicitConversionAsNoImplicitConversionByReference(self):
     '''Gives an ExtendsNoImplicitConversion object to a function expecting a NoImplicitConversion, passing by reference.'''
     obj = ExtendsNoImplicitConversion(123)
     self.assertEqual(obj.objId(), NoImplicitConversion.receivesNoImplicitConversionByReference(obj))