test

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadError   = Error("ReadError")
	WriteError  = Error("WriteError")
	SecondError = Error("SecondError")
)
View Source
var (
	ObjectA = &TypeA{Data: "ObjectA"}
	EntityA = []byte{
		0x04, 't', 'e', 's', 't',
		0x05, 'T', 'y', 'p', 'e', 'A',
		0x00,
		0x01,
		0xb0,
	}
	EntityAFull = []byte{
		0x04, 't', 'e', 's', 't',
		0x05, 'T', 'y', 'p', 'e', 'A',
		0x00,
		0x00,
		0x01,
		0xb0,
		0x06, 's', 't', 'r', 'i', 'n', 'g',
		0x04, 'D', 'a', 't', 'a',
		0x00,
	}
	ObjectB = &TypeB{Data: "ObjectB"}
	EntityB = []byte{
		0x04, 't', 'e', 's', 't',
		0x05, 'T', 'y', 'p', 'e', 'B',
		0x00,
		0x01,
		0xb0,
	}
	ObjectC = &TypeC{Data: Simple(3)}
	EntityC = []byte{
		0x04, 't', 'e', 's', 't',
		0x05, 'T', 'y', 'p', 'e', 'C',
		0x00,
		0x01,
		0x10,
	}
	BadObject = &BadType{Data: "BadObject"}
)

Functions

func ReadWrite

func ReadWrite(ctx context.Context, tests []ReadWriteTests, factory Factory)

func ReadWriteCount

func ReadWriteCount(ctx context.Context, values []uint32, raw []byte, factory Factory)

func ReadWriteData

func ReadWriteData(ctx context.Context, tests []ReadWriteTests, factory Factory)

func ReadWriteErrors

func ReadWriteErrors(ctx context.Context, tests []ReadWriteTests, factory Factory)

func ReadWriteIOErrors

func ReadWriteIOErrors(ctx context.Context, tests []ReadWriteTests, factory Factory)

func ReadWriteSimple

func ReadWriteSimple(ctx context.Context, values []Simple, raw []byte, factory Factory)

func VerifyData

func VerifyData(ctx context.Context, entry Entry, got *bytes.Buffer)

Types

type Anonymous

type Anonymous struct {
	Leaf
}

type Array

type Array struct {
	Leaves [3]Leaf
}

type ArrayInMap

type ArrayInMap struct {
	M Uint32ː3_Leaf
}

type ArrayOfArrays

type ArrayOfArrays struct {
	Array [2][3]Leaf
}

type BadType

type BadType struct {
	Data string
}

type Bytes

type Bytes struct {
	Data []byte
}

func (Bytes) Add

func (b Bytes) Add(data ...byte) Bytes

func (*Bytes) Read

func (d *Bytes) Read(b []byte) (int, error)

type Complex

type Complex struct {
	SliceMapArray []Containsː3_Contains
	SliceArrayMap [][3]ContainsːContains
	ArraySliceMap [3][]ContainsːContains
	ArrayMapSlice [3]ContainsːSliceContains
	MapArraySlice Containsː3_SliceContains
	MapSliceArray ContainsːSlice3_Contains
}

type Contains

type Contains struct {
	LeafField Leaf
}

type Contains_SortKeys

type Contains_SortKeys []Contains

func (Contains_SortKeys) Len

func (s Contains_SortKeys) Len() int

func (Contains_SortKeys) Less

func (s Contains_SortKeys) Less(i, j int) bool

func (Contains_SortKeys) Swap

func (s Contains_SortKeys) Swap(i, j int)

type Containsː3_Contains

type Containsː3_Contains map[Contains][3]Contains

func (Containsː3_Contains) KeysSorted

func (m Containsː3_Contains) KeysSorted() []Contains

type Containsː3_SliceContains

type Containsː3_SliceContains map[Contains][3][]Contains

func (Containsː3_SliceContains) KeysSorted

func (m Containsː3_SliceContains) KeysSorted() []Contains

type ContainsːContains

type ContainsːContains map[Contains]Contains

func (ContainsːContains) KeysSorted

func (m ContainsːContains) KeysSorted() []Contains

type ContainsːSlice3_Contains

type ContainsːSlice3_Contains map[Contains][][3]Contains

func (ContainsːSlice3_Contains) KeysSorted

func (m ContainsːSlice3_Contains) KeysSorted() []Contains

type ContainsːSliceContains

type ContainsːSliceContains map[Contains][]Contains

func (ContainsːSliceContains) KeysSorted

func (m ContainsːSliceContains) KeysSorted() []Contains

type Entry

type Entry struct {
	Name string
	Data []byte
}

type Error

type Error string

func (Error) Error

func (d Error) Error() string

type Factory

type Factory func(io.Reader, io.Writer) (binary.Reader, binary.Writer)

type Leaf

type Leaf struct {
	A uint32
}

type Leaf_SortKeys

type Leaf_SortKeys []Leaf

func (Leaf_SortKeys) Len

func (s Leaf_SortKeys) Len() int

func (Leaf_SortKeys) Less

func (s Leaf_SortKeys) Less(i, j int) bool

func (Leaf_SortKeys) Swap

func (s Leaf_SortKeys) Swap(i, j int)

type LeafːLeaf

type LeafːLeaf map[Leaf]Leaf

func (LeafːLeaf) KeysSorted

func (m LeafːLeaf) KeysSorted() []Leaf

type Leafːuint32

type Leafːuint32 map[Leaf]uint32

func (Leafːuint32) KeysSorted

func (m Leafːuint32) KeysSorted() []Leaf

type LimitedWriter

type LimitedWriter struct{ Limit int }

func (*LimitedWriter) Write

func (d *LimitedWriter) Write(b []byte) (int, error)

type MapInArray

type MapInArray struct {
	Array [2]Uint32ːuint32
}

type MapInSlice

type MapInSlice struct {
	Slice []Uint32ːuint32
}

type MapKey

type MapKey struct {
	M Leafːuint32
}

type MapKeyValue

type MapKeyValue struct {
	M LeafːLeaf
}

type MapOfMaps

type MapOfMaps struct {
	M Uint32ːLeafːLeaf
}

type MapValue

type MapValue struct {
	M Uint32ːLeaf
}

type ReadWriteTests

type ReadWriteTests struct {
	Name   string
	Values interface{}
	Data   []byte
}

type Simple

type Simple int8

func (*Simple) ReadSimple

func (s *Simple) ReadSimple(r binary.Reader)

func (Simple) WriteSimple

func (s Simple) WriteSimple(w binary.Writer)

type Slice

type Slice struct {
	Leaves []Leaf
}

type SliceInMap

type SliceInMap struct {
	M Uint32ːSliceLeaf
}

type SliceOfSlices

type SliceOfSlices struct {
	Slice [][]Leaf
}

type TypeA

type TypeA struct {
	Data string
}

type TypeB

type TypeB struct {
	Data string
}

type TypeC

type TypeC struct {
	Data Simple
}

type Uint32_SortKeys

type Uint32_SortKeys []uint32

func (Uint32_SortKeys) Len

func (s Uint32_SortKeys) Len() int

func (Uint32_SortKeys) Less

func (s Uint32_SortKeys) Less(i, j int) bool

func (Uint32_SortKeys) Swap

func (s Uint32_SortKeys) Swap(i, j int)

type Uint32ː3_Leaf

type Uint32ː3_Leaf map[uint32][3]Leaf

func (Uint32ː3_Leaf) KeysSorted

func (m Uint32ː3_Leaf) KeysSorted() []uint32

type Uint32ːLeaf

type Uint32ːLeaf map[uint32]Leaf

func (Uint32ːLeaf) KeysSorted

func (m Uint32ːLeaf) KeysSorted() []uint32

type Uint32ːLeafːLeaf

type Uint32ːLeafːLeaf map[uint32]LeafːLeaf

func (Uint32ːLeafːLeaf) KeysSorted

func (m Uint32ːLeafːLeaf) KeysSorted() []uint32

type Uint32ːSliceLeaf

type Uint32ːSliceLeaf map[uint32][]Leaf

func (Uint32ːSliceLeaf) KeysSorted

func (m Uint32ːSliceLeaf) KeysSorted() []uint32

type Uint32ːuint32

type Uint32ːuint32 map[uint32]uint32

func (Uint32ːuint32) KeysSorted

func (m Uint32ːuint32) KeysSorted() []uint32

Jump to

Keyboard shortcuts

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