mobile: Index | Files | Directories

package testpkg

import ""

Package testpkg contains bound functions for testing the cgo-JNI interface. This is used in tests of


Package Files



const (
    AString = "a string"
    AnInt   = 7
    ABool   = true
    AFloat  = 0.12345

    MinInt32               int32   = math.MinInt32
    MaxInt32               int32   = math.MaxInt32
    MinInt64                       = math.MinInt64
    MaxInt64                       = math.MaxInt64
    SmallestNonzeroFloat64         = math.SmallestNonzeroFloat64
    MaxFloat64                     = math.MaxFloat64
    SmallestNonzeroFloat32 float32 = math.SmallestNonzeroFloat64
    MaxFloat32             float32 = math.MaxFloat32
    Log2E                          = math.Log2E


var (
    StringVar     = "a string var"
    IntVar        = 77
    StructVar     = &S{name: "a struct var"}
    InterfaceVar  I
    InterfaceVar2 I2
    NodeVar       = &Node{V: "a struct var"}
var (
    ImportedVarI secondpkg.I  = NewImportedI()
    ImportedVarS *secondpkg.S = NewImportedS()
var GlobalErr error = errors.New("global err")

func Add Uses

func Add(x, y int) int

func AppendHello Uses

func AppendHello(s string) string

func AppendToString Uses

func AppendToString(str string, someBytes []byte) []byte

func BytesAppend Uses

func BytesAppend(a []byte, b []byte) []byte

func CallCDupper Uses

func CallCDupper(d ConcreteDupper) bool

func CallE Uses

func CallE(i I) error

func CallEmptyError Uses

func CallEmptyError(c EmptyErrorer) error

func CallF Uses

func CallF(i I)

func CallIDupper Uses

func CallIDupper(d InterfaceDupper) bool

func CallIError Uses

func CallIError(i I2, triggerError bool) error

func CallIStringError Uses

func CallIStringError(i I2, s string) (string, error)

func CallImportedI Uses

func CallImportedI(i secondpkg.I)

func CallSSum Uses

func CallSSum(s *S2) float64

func CallV Uses

func CallV(i I) int

func CallVE Uses

func CallVE(i I) (int, error)

func CallWithCallback Uses

func CallWithCallback(gcb GoCallback)

func CallWithNull Uses

func CallWithNull(_null NullTest, nuller NullTest) bool

func CollectS2 Uses

func CollectS2(want, timeoutSec int) int

func EmptyError Uses

func EmptyError() error

func Err Uses

func Err(s string) error

func ErrorMessage Uses

func ErrorMessage(err error) string

func GC Uses

func GC()

func GarbageCollect Uses

func GarbageCollect()

func GoroutineCallback Uses

func GoroutineCallback(r Receiver)

func Hello Uses

func Hello(r Receiver, name string)

func Hi Uses

func Hi()

func Init Uses

func Init()

func Int Uses

func Int(x int32)

func IsGlobalErr Uses

func IsGlobalErr(err error) bool

func Keep Uses

func Keep(i I)

func Multiply Uses

func Multiply(idx int32, val int32) int64

func Negate Uses

func Negate(x bool) bool

func NewImportedI Uses

func NewImportedI() secondpkg.I

func NewImportedS Uses

func NewImportedS() *secondpkg.S

func NewSimpleS Uses

func NewSimpleS() *simplepkg.S

func NumSCollected Uses

func NumSCollected() int

func PassByteArray Uses

func PassByteArray(b B)

func ReadAsset Uses

func ReadAsset() string

func ReadIntoByteArray Uses

func ReadIntoByteArray(s []byte) (int, error)

func RegisterI Uses

func RegisterI(idx int32, i I2)

func ReturnsError Uses

func ReturnsError(b bool) (string, error)

func StrDup Uses

func StrDup(s string) string

func TestSIGPIPE Uses

func TestSIGPIPE()

Lifted from TestEPIPE in package os.

func UnboundI Uses

func UnboundI(_ unboundpkg.I)

func UnboundS Uses

func UnboundS(_ *unboundpkg.S)

func UnnamedParams Uses

func UnnamedParams(_, _ int, p0 string) int

func UnregisterI Uses

func UnregisterI(idx int32)

func WithImportedI Uses

func WithImportedI(i secondpkg.I) secondpkg.I

func WithImportedS Uses

func WithImportedS(s *secondpkg.S) *secondpkg.S

type AnSer Uses

type AnSer struct{}

func NewSer Uses

func NewSer() *AnSer

func (*AnSer) S Uses

func (_ *AnSer) S(_ *secondpkg.S)

type B Uses

type B interface {
    B(b []byte)

type Concrete Uses

type Concrete struct{}

func NewConcrete Uses

func NewConcrete() *Concrete

func (*Concrete) F Uses

func (_ *Concrete) F()

type ConcreteDupper Uses

type ConcreteDupper interface {
    CDup(c *Concrete) *Concrete

type EmptyErrorer Uses

type EmptyErrorer interface {
    EmptyError() error

type GoCallback Uses

type GoCallback interface {

type I Uses

type I interface {

    E() error
    V() int
    VE() (int, error)
    I() I
    S() *S
    StoString(seq *S) string

    String() string

func CallI Uses

func CallI(i I) I

func IDup Uses

func IDup(i I) I

func NewNullInterface Uses

func NewNullInterface() I

type I2 Uses

type I2 interface {
    Times(v int32) int64
    Error(triggerError bool) error

    StringError(s string) (string, error)

func I2Dup Uses

func I2Dup(i I2) I2

func NewI Uses

func NewI() I2

type ImportedFields Uses

type ImportedFields struct {
    I   secondpkg.I
    S   *secondpkg.S

func NewImportedFields Uses

func NewImportedFields() *ImportedFields

type ImportedI Uses

type ImportedI interface {
    F(_ secondpkg.I)

type InitCaller Uses

type InitCaller struct{}

func NewInitCaller Uses

func NewInitCaller() *InitCaller

func (*InitCaller) Init Uses

func (ic *InitCaller) Init()

type Interface Uses

type Interface interface {

type InterfaceDupper Uses

type InterfaceDupper interface {
    IDup(i Interface) Interface

type Issue14168 Uses

type Issue14168 interface {
    F(seq int32)

type Issue17073 Uses

type Issue17073 interface {
    OnError(err error)

type Issue20330 Uses

type Issue20330 struct{}

func NewIssue20330 Uses

func NewIssue20330() *Issue20330

func (*Issue20330) CallWithNull Uses

func (i *Issue20330) CallWithNull(_null *Issue20330) bool

type Node Uses

type Node struct {
    V    string
    Next *Node
    Err  error

func NewNode Uses

func NewNode(name string) *Node

func (*Node) String Uses

func (a *Node) String() string

type NullFieldStruct Uses

type NullFieldStruct struct {
    F *S

Issue #13033

func NewNullFieldStruct Uses

func NewNullFieldStruct() *NullFieldStruct

type NullTest Uses

type NullTest interface {
    Null() NullTest

type Nummer Uses

type Nummer interface {

type Receiver Uses

type Receiver interface {
    Hello(message string)

type S Uses

type S struct {
    // contains filtered or unexported fields

func CallS Uses

func CallS(i I) *S

func New Uses

func New() *S

func NewNullStruct Uses

func NewNullStruct() *S

func (*S) F Uses

func (s *S) F()

func (*S) String Uses

func (s *S) String() string

type S2 Uses

type S2 struct {
    X, Y float64
    // contains filtered or unexported fields

func NewS2 Uses

func NewS2(x, y float64) *S2

func (*S2) Sum Uses

func (s *S2) Sum() float64

func (*S2) TryTwoStrings Uses

func (_ *S2) TryTwoStrings(first, second string) string

type S3 Uses

type S3 struct {

type S4 Uses

type S4 struct {
    I int

func NewS4WithBoolAndError Uses

func NewS4WithBoolAndError(b bool) (*S4, error)

func NewS4WithFloat Uses

func NewS4WithFloat(f float64) *S4

func NewS4WithInt Uses

func NewS4WithInt(i int) *S4


secondpkgPackage secondpkg is imported by bind tests that verify that a bound package can reference another bound package.
simplepkgPackage simplepkg is imported from testpkg and tests two corner cases.
unboundpkgPackage simplepkg is imported from testpkg and tests that references to other, unbound packages, are ignored.

Package testpkg imports 13 packages (graph). Updated 2017-11-19. Refresh now. Tools for package owners.