testpkg

package
v0.0.0-...-8b1022e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2016 License: Apache-2.0, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package testpkg contains bound functions for testing the cgo-JNI interface. This is used in tests of golang.org/x/mobile/bind/java.

Index

Constants

View Source
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
)

Variables

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

Functions

func Add

func Add(x, y int) int

func AppendHello

func AppendHello(s string) string

func AppendToString

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

func BytesAppend

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

func CallCDupper

func CallCDupper(d ConcreteDupper) bool

func CallE

func CallE(i I) error

func CallF

func CallF(i I)

func CallIDupper

func CallIDupper(d InterfaceDupper) bool

func CallIError

func CallIError(i I2, triggerError bool) error

func CallIStringError

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

func CallImportedI

func CallImportedI(i secondpkg.I)

func CallSSum

func CallSSum(s *S2) float64

func CallV

func CallV(i I) int

func CallVE

func CallVE(i I) (int, error)

func CallWithCallback

func CallWithCallback(gcb GoCallback)

func CallWithNull

func CallWithNull(_null NullTest, nuller NullTest) bool

func CollectS2

func CollectS2(want, timeoutSec int) int

func Err

func Err(s string) error

func GC

func GC()

func GarbageCollect

func GarbageCollect()

func GoroutineCallback

func GoroutineCallback(r Receiver)

func Hello

func Hello(r Receiver, name string)

func Hi

func Hi()

func Int

func Int(x int32)

func Keep

func Keep(i I)

func Multiply

func Multiply(idx int32, val int32) int64

func Negate

func Negate(x bool) bool

func NewImportedI

func NewImportedI() secondpkg.I

func NewImportedS

func NewImportedS() *secondpkg.S

func NewSimpleS

func NewSimpleS() *simplepkg.S

func NumSCollected

func NumSCollected() int

func PassByteArray

func PassByteArray(b B)

func ReadAsset

func ReadAsset() string

func ReadIntoByteArray

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

func RegisterI

func RegisterI(idx int32, i I2)

func ReturnsError

func ReturnsError(b bool) (string, error)

func StrDup

func StrDup(s string) string

func UnboundI

func UnboundI(_ unboundpkg.I)

func UnboundS

func UnboundS(_ *unboundpkg.S)

func UnnamedParams

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

func UnregisterI

func UnregisterI(idx int32)

func WithImportedI

func WithImportedI(i secondpkg.I) secondpkg.I

func WithImportedS

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

Types

type AnSer

type AnSer struct{}

func NewSer

func NewSer() *AnSer

func (*AnSer) S

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

type B

type B interface {
	B(b []byte)
}

type Concrete

type Concrete struct{}

func NewConcrete

func NewConcrete() *Concrete

func (*Concrete) F

func (_ *Concrete) F()

type ConcreteDupper

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

type GoCallback

type GoCallback interface {
	VarUpdate()
}

type I

type I interface {
	F()

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

	String() string
}

func CallI

func CallI(i I) I

func IDup

func IDup(i I) I

func NewNullInterface

func NewNullInterface() I

type I2

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

	StringError(s string) (string, error)
}

func I2Dup

func I2Dup(i I2) I2

func NewI

func NewI() I2

type ImportedFields

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

func NewImportedFields

func NewImportedFields() *ImportedFields

type ImportedI

type ImportedI interface {
	F(_ secondpkg.I)
}

type Interface

type Interface interface {
	F()
}

type InterfaceDupper

type InterfaceDupper interface {
	IDup(i Interface) Interface
}

type Issue14168

type Issue14168 interface {
	F(seq int32)
}

type Node

type Node struct {
	V    string
	Next *Node
	Err  error
}

func NewNode

func NewNode(name string) *Node

func (*Node) String

func (a *Node) String() string

type NullFieldStruct

type NullFieldStruct struct {
	F *S
}

Issue #13033

func NewNullFieldStruct

func NewNullFieldStruct() *NullFieldStruct

type NullTest

type NullTest interface {
	Null() NullTest
}

type Nummer

type Nummer interface {
	Num()
}

type Receiver

type Receiver interface {
	Hello(message string)
}

type S

type S struct {
	// contains filtered or unexported fields
}

func CallS

func CallS(i I) *S

func New

func New() *S

func NewNullStruct

func NewNullStruct() *S

func (*S) F

func (s *S) F()

func (*S) String

func (s *S) String() string

type S2

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

func NewS2

func NewS2(x, y float64) *S2

func (*S2) Sum

func (s *S2) Sum() float64

func (*S2) TryTwoStrings

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

Directories

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL