Loading experiments/PassByReference.ttcn 0 → 100644 +27 −0 Original line number Diff line number Diff line // @verdict: pass accept, ttcn3verdict:pass // @purpose: Assure that resizing references does not break execution. module PassByReference { type record of integer RoI; testcase reallocation() runs on C { var RoI a := {1,2,3} resize(a[0], a); if (match(a, {111, 2, 3, * , 999})) { setverdict(pass) } } function resize(inout integer i, inout RoI a) { // force a reallocation a[4096] := 999; // update old reference i := 111; } type component C {} control { execute(reallocation()); } } Loading
experiments/PassByReference.ttcn 0 → 100644 +27 −0 Original line number Diff line number Diff line // @verdict: pass accept, ttcn3verdict:pass // @purpose: Assure that resizing references does not break execution. module PassByReference { type record of integer RoI; testcase reallocation() runs on C { var RoI a := {1,2,3} resize(a[0], a); if (match(a, {111, 2, 3, * , 999})) { setverdict(pass) } } function resize(inout integer i, inout RoI a) { // force a reallocation a[4096] := 999; // update old reference i := 111; } type component C {} control { execute(reallocation()); } }