/trunk/Examples/test-suite/go/smart_pointer_member_runme.go
Go | 30 lines | 23 code | 7 blank | 0 comment | 8 complexity | bb2712b232f15a26d2ace3f3c031629a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- package main
- import "fmt"
- import . "./smart_pointer_member"
- func main() {
- f := NewFoo()
- f.SetY(1)
- if f.GetY() != 1 {
- panic(0)
- }
- b := NewBar(f)
- b.SetY(2)
- if f.GetY() != 2 {
- fmt.Println(f.GetY())
- fmt.Println(b.GetY())
- panic(0)
- }
- if b.GetX() != f.GetX() {
- panic(0)
- }
- if b.GetZ() != GetFooZ() {
- panic(0)
- }
- }