Skip to content

Commit 24baadf

Browse files
committed
extending test to cover negative outcome of bool->double|float
1 parent af1b937 commit 24baadf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/tests/test_method.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ def testSimpleTypePromotionIntToDouble(self):
227227
self.assertTrue(False,"the promotion of string to double should fail")
228228
except:
229229
pass
230+
try:
231+
should_fail = object.TestSimpleIntToDoubleTypePromotion(2,True)
232+
self.assertTrue(False,"the promotion of boolean to double should fail")
233+
except:
234+
pass
230235

231236
def testSimpleTypePromotionIntToFloat(self):
232237
object = MethodTest()
@@ -242,10 +247,15 @@ def testSimpleTypePromotionIntToFloat(self):
242247
except:
243248
self.assertTrue(False,"Type promotion from int to float failed")
244249
try:
245-
should_fail = object.TestSimpleIntToDoubleTypePromotion(2,'2.0')
250+
should_fail = object.TestSimpleIntToFloatTypePromotion(2,'2.0')
246251
self.assertTrue(False,"the promotion of string to float should fail")
247252
except:
248253
pass
254+
try:
255+
should_fail = object.TestSimpleIntToFloatTypePromotion(2,True)
256+
self.assertTrue(False,"the promotion of boolean to float should fail")
257+
except:
258+
pass
249259

250260
def testMethodCallStructConversion(self):
251261
"""Test struct conversion in method call."""

0 commit comments

Comments
 (0)