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

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

#
Go | 25 lines | 19 code | 5 blank | 1 comment | 4 complexity | 5755ce273d0a8d7ac04d9ced75454a6b MD5 | raw file
 1package main
 2
 3import . "./char_binary"
 4
 5func main() {
 6	t := NewTest()
 7	if t.Strlen("hile") != 4 {
 8		print(t.Strlen("hile"))
 9		panic("bad multi-arg typemap")
10	}
11
12	if t.Strlen("hil\000") != 4 {
13		panic("bad multi-arg typemap")
14	}
15
16	// creating a raw char*
17	pc := New_pchar(5)
18	Pchar_setitem(pc, 0, 'h')
19	Pchar_setitem(pc, 1, 'o')
20	Pchar_setitem(pc, 2, 'l')
21	Pchar_setitem(pc, 3, 'a')
22	Pchar_setitem(pc, 4, 0)
23
24	Delete_pchar(pc)
25}