2
# This is the union runtime testcase. It ensures that values within a
3
# union embedded within a struct can be set and read correctly.
7
# Create new instances of SmallStruct and BigStruct for later use
8
small = Unions::SmallStruct.new()
11
big = Unions::BigStruct.new()
12
big.smallstruct = small
15
# Use SmallStruct then BigStruct to setup EmbeddedUnionTest.
16
# Ensure values in EmbeddedUnionTest are set correctly for each.
17
eut = Unions::EmbeddedUnionTest.new()
19
# First check the SmallStruct in EmbeddedUnionTest
22
Jill1 = eut.uni.small.jill
24
print "Runtime test1 failed. eut.uni.small.jill=" , Jill1 , "\n"
30
print "Runtime test2 failed. eut.number=" , Num1 , "\n"
34
# Secondly check the BigStruct in EmbeddedUnionTest
37
Jack1 = eut.uni.big.jack
39
print "Runtime test3 failed. eut.uni.big.jack=" , Jack1 , "\n"
43
Jill2 = eut.uni.big.smallstruct.jill
45
print "Runtime test4 failed. eut.uni.big.smallstruct.jill=" , Jill2 , "\n"
51
print "Runtime test5 failed. eut.number=" , Num2 , "\n"