Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
extending test to cover negative outcome of bool->double|float
  • Loading branch information
sigbjorn committed Jul 3, 2016
commit 24baadffeef457fb9b8c9f2cebc42aaae3ca95ba
12 changes: 11 additions & 1 deletion src/tests/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ def testSimpleTypePromotionIntToDouble(self):
self.assertTrue(False,"the promotion of string to double should fail")
except:
pass
try:
should_fail = object.TestSimpleIntToDoubleTypePromotion(2,True)
self.assertTrue(False,"the promotion of boolean to double should fail")
except:
pass

def testSimpleTypePromotionIntToFloat(self):
object = MethodTest()
Expand All @@ -242,10 +247,15 @@ def testSimpleTypePromotionIntToFloat(self):
except:
self.assertTrue(False,"Type promotion from int to float failed")
try:
should_fail = object.TestSimpleIntToDoubleTypePromotion(2,'2.0')
should_fail = object.TestSimpleIntToFloatTypePromotion(2,'2.0')
self.assertTrue(False,"the promotion of string to float should fail")
except:
pass
try:
should_fail = object.TestSimpleIntToFloatTypePromotion(2,True)
self.assertTrue(False,"the promotion of boolean to float should fail")
except:
pass

def testMethodCallStructConversion(self):
"""Test struct conversion in method call."""
Expand Down