PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. package main
  2. import . "./array_member"
  3. func main() {
  4. f := NewFoo()
  5. f.SetData(GetGlobal_data())
  6. for i := 0; i < 8; i++ {
  7. if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
  8. panic("Bad array assignment")
  9. }
  10. }
  11. for i := 0; i < 8; i++ {
  12. Set_value(f.GetData(), i, -i)
  13. }
  14. SetGlobal_data(f.GetData())
  15. for i := 0; i < 8; i++ {
  16. if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
  17. panic("Bad array assignment")
  18. }
  19. }
  20. }