コード例 #1
0
 def testLongAsDouble(self):
     '''Float as double'''
     self.check_value(l(42), 42, sample.acceptDouble, float)
コード例 #2
0
 def testLongAsUInt(self):
     '''Long as unsigned Int'''
     self.check_value(l(260), 260, sample.acceptUInt, long)
     self.assertRaises(OverflowError, sample.acceptUInt, -42)
コード例 #3
0
 def testLongAsULong(self):
     '''Long as unsigned Long'''
     self.check_value(l(128), 128, sample.acceptULong, long)
     self.assertRaises(OverflowError, sample.acceptULong, l(-334))
コード例 #4
0
 def testLongAsInt(self):
     '''Long as Int'''
     self.check_value(l(24224), 24224, sample.acceptInt, int)
     self.assertRaises(OverflowError, sample.acceptInt, cIntMax + 20)
コード例 #5
0
 def testLongAsLong(self):
     '''Long as Long'''
     self.check_value(l(2405), 2405, sample.acceptLong, int)
     self.assertRaises(OverflowError, sample.acceptLong, cLongMax + 20)
コード例 #6
0
 def testLongAsDouble(self):
     '''Float as double'''
     self.check_value(l(42), 42, sample.acceptDouble, float)
コード例 #7
0
 def testLongAsULong(self):
     '''Long as unsigned Long'''
     self.check_value(l(128), 128, sample.acceptULong, long)
     self.assertRaises(OverflowError, sample.acceptULong, l(-334))
コード例 #8
0
 def testLongAsUInt(self):
     '''Long as unsigned Int'''
     self.check_value(l(260), 260, sample.acceptUInt, long)
     self.assertRaises(OverflowError, sample.acceptUInt, -42)
コード例 #9
0
 def testLongAsLong(self):
     '''Long as Long'''
     self.check_value(l(2405), 2405, sample.acceptLong, int)
     self.assertRaises(OverflowError, sample.acceptLong, sys.maxint + 20)
コード例 #10
0
 def testLongAsInt(self):
     '''Long as Int'''
     self.check_value(l(24224), 24224, sample.acceptInt, int)
     self.assertRaises(OverflowError, sample.acceptInt, sys.maxint + 20)