PageRenderTime 37ms CodeModel.GetById 13ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. package main
  2. import . "./char_binary"
  3. func main() {
  4. t := NewTest()
  5. if t.Strlen("hile") != 4 {
  6. print(t.Strlen("hile"))
  7. panic("bad multi-arg typemap")
  8. }
  9. if t.Strlen("hil\000") != 4 {
  10. panic("bad multi-arg typemap")
  11. }
  12. // creating a raw char*
  13. pc := New_pchar(5)
  14. Pchar_setitem(pc, 0, 'h')
  15. Pchar_setitem(pc, 1, 'o')
  16. Pchar_setitem(pc, 2, 'l')
  17. Pchar_setitem(pc, 3, 'a')
  18. Pchar_setitem(pc, 4, 0)
  19. Delete_pchar(pc)
  20. }