PageRenderTime 41ms CodeModel.GetById 35ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/go/array_member_runme.go

#
Go | 26 lines | 20 code | 6 blank | 0 comment | 7 complexity | fbcede4c43d47afa0eae672ea64c4ce4 MD5 | raw file
 1package main
 2
 3import . "./array_member"
 4
 5func main() {
 6	f := NewFoo()
 7	f.SetData(GetGlobal_data())
 8
 9	for i := 0; i < 8; i++ {
10		if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
11			panic("Bad array assignment")
12		}
13	}
14
15	for i := 0; i < 8; i++ {
16		Set_value(f.GetData(), i, -i)
17	}
18
19	SetGlobal_data(f.GetData())
20
21	for i := 0; i < 8; i++ {
22		if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
23			panic("Bad array assignment")
24		}
25	}
26}