diff options
Diffstat (limited to 'spew/testdata')
| -rw-r--r-- | spew/testdata/dumpcgo.go | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/spew/testdata/dumpcgo.go b/spew/testdata/dumpcgo.go index 2e98452..5c87dd4 100644 --- a/spew/testdata/dumpcgo.go +++ b/spew/testdata/dumpcgo.go @@ -51,31 +51,32 @@ func GetCgoCharPointer() interface{} { return C.cp } -// GetCgoCharArray returns a char array via cgo. This is only used for tests. -func GetCgoCharArray() interface{} { - return C.ca +// GetCgoCharArray returns a char array via cgo and the array's len and cap. +// This is only used for tests. +func GetCgoCharArray() (interface{}, int, int) { + return C.ca, len(C.ca), cap(C.ca) } -// GetCgoUnsignedCharArray returns an unsigned char array via cgo. This is only -// used for tests. -func GetCgoUnsignedCharArray() interface{} { - return C.uca +// GetCgoUnsignedCharArray returns an unsigned char array via cgo and the +// array's len and cap. This is only used for tests. +func GetCgoUnsignedCharArray() (interface{}, int, int) { + return C.uca, len(C.uca), cap(C.uca) } -// GetCgoSignedCharArray returns a signed char array via cgo. This is only used -// for tests. -func GetCgoSignedCharArray() interface{} { - return C.sca +// GetCgoSignedCharArray returns a signed char array via cgo and the array's len +// and cap. This is only used for tests. +func GetCgoSignedCharArray() (interface{}, int, int) { + return C.sca, len(C.sca), cap(C.sca) } -// GetCgoUint8tArray returns a uint8_t array via cgo. This is only used for -// tests. -func GetCgoUint8tArray() interface{} { - return C.ui8ta +// GetCgoUint8tArray returns a uint8_t array via cgo and the array's len and +// cap. This is only used for tests. +func GetCgoUint8tArray() (interface{}, int, int) { + return C.ui8ta, len(C.ui8ta), cap(C.ui8ta) } // GetCgoTypdefedUnsignedCharArray returns a typedefed unsigned char array via -// cgo. This is only used for tests. -func GetCgoTypdefedUnsignedCharArray() interface{} { - return C.tuca +// cgo and the array's len and cap. This is only used for tests. +func GetCgoTypdefedUnsignedCharArray() (interface{}, int, int) { + return C.tuca, len(C.tuca), cap(C.tuca) } |
