summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/unions_runme.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/python/unions_runme.py')
-rw-r--r--Examples/test-suite/python/unions_runme.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Examples/test-suite/python/unions_runme.py b/Examples/test-suite/python/unions_runme.py
index 387a048c8..5a3ee3b5c 100644
--- a/Examples/test-suite/python/unions_runme.py
+++ b/Examples/test-suite/python/unions_runme.py
@@ -3,7 +3,6 @@
# union embedded within a struct can be set and read correctly.
import unions
-import sys
import string
# Create new instances of SmallStruct and BigStruct for later use
@@ -23,28 +22,23 @@ eut.number = 1
eut.uni.small = small
Jill1 = eut.uni.small.jill
if (Jill1 != 200):
- print "Runtime test1 failed. eut.uni.small.jill=", Jill1
- sys.exit(1)
+ raise RuntimeError("Runtime test1 failed. eut.uni.small.jill={}".format(Jill1))
Num1 = eut.number
if (Num1 != 1):
- print "Runtime test2 failed. eut.number=", Num1
- sys.exit(1)
+ raise RuntimeError("Runtime test2 failed. eut.number=".format(Num1))
# Secondly check the BigStruct in EmbeddedUnionTest
eut.number = 2
eut.uni.big = big
Jack1 = eut.uni.big.jack
if (Jack1 != 300):
- print "Runtime test3 failed. eut.uni.big.jack=", Jack1
- sys.exit(1)
+ raise RuntimeError("Runtime test3 failed. eut.uni.big.jack={}".format(Jack1))
Jill2 = eut.uni.big.smallstruct.jill
if (Jill2 != 200):
- print "Runtime test4 failed. eut.uni.big.smallstruct.jill=", Jill2
- sys.exit(1)
+ raise RuntimeError("Runtime test4 failed. eut.uni.big.smallstruct.jill={}".format(Jill2))
Num2 = eut.number
if (Num2 != 2):
- print "Runtime test5 failed. eut.number=", Num2
- sys.exit(1)
+ raise RuntimeError("Runtime test5 failed. eut.number={}".format(Num2))