Beispiel #1
0
 def testPassValueType(self):
     val = Val(123)
     val1 = val.passValueType(val)
     self.assertNotEqual(val, val1)
     self.assertEqual(val1.valId(), 123)
     val2 = val.callPassValueType(val)
     self.assertNotEqual(val, val2)
     self.assertEqual(val2.valId(), 123)
Beispiel #2
0
 def testPassValueType(self):
     val = Val(123)
     val1 = val.passValueType(val)
     self.assertNotEqual(val, val1)
     self.assertEqual(val1.valId(), 123)
     val2 = val.callPassValueType(val)
     self.assertNotEqual(val, val2)
     self.assertEqual(val2.valId(), 123)
 def testSumValListFromExtendedClass(self):
     lu = ExtListUser()
     lst = [Val(i) for i in range(4)]
     self.assertEqual(lu.sumValList(lst),
                      sum([val.valId() for val in lst]) * 2)
     self.assertEqual(lu.callSumValList(lst),
                      sum([val.valId() for val in lst]) * 2)
Beispiel #4
0
 def testPassAndReceiveEnumValue(self):
     val = Val(0)
     self.assertEqual(val.oneOrTheOtherEnumValue(Val.One), Val.Other)
     self.assertEqual(val.oneOrTheOtherEnumValue(Val.Other), Val.One)
Beispiel #5
0
 def testPassValueTypeReference(self):
     val = Val(0)
     self.assertEqual(val, val.passValueTypeReference(val))
     self.assertEqual(val, val.callPassValueTypeReference(val))
Beispiel #6
0
 def testPassValueTypePointer(self):
     val = Val(0)
     self.assertEqual(val, val.passValueTypePointer(val))
     self.assertEqual(val, val.callPassValueTypePointer(val))
Beispiel #7
0
 def testNormalMethod(self):
     valId = 123
     val = Val(valId)
     self.assertEqual(val.valId(), valId)
Beispiel #8
0
 def __init__(self, valId):
     Val.__init__(self, valId)
 def createValList(self, num):
     return [Val(i) for i in range(0, num * 2, 2)]
 def testSumValList(self):
     lu = ListUser()
     lst = [Val(i) for i in range(4)]
     self.assertEqual(lu.sumValList(lst), sum([val.valId() for val in lst]))
     self.assertEqual(lu.callSumValList(lst),
                      sum([val.valId() for val in lst]))
Beispiel #11
0
 def testPassAndReceiveEnumValue(self):
     val = Val(0)
     self.assertEqual(val.oneOrTheOtherEnumValue(Val.One), Val.Other)
     self.assertEqual(val.oneOrTheOtherEnumValue(Val.Other), Val.One)
Beispiel #12
0
 def testPassValueTypeReference(self):
     val = Val(0)
     self.assertEqual(val, val.passValueTypeReference(val))
     self.assertEqual(val, val.callPassValueTypeReference(val))
Beispiel #13
0
 def testPassValueTypePointer(self):
     val = Val(0)
     self.assertEqual(val, val.passValueTypePointer(val))
     self.assertEqual(val, val.callPassValueTypePointer(val))
Beispiel #14
0
 def testNormalMethod(self):
     valId = 123
     val = Val(valId)
     self.assertEqual(val.valId(), valId)
Beispiel #15
0
 def __init__(self, valId):
     Val.__init__(self, valId)