testing

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aligned8Byte

func Aligned8Byte(fields []FieldOffset, out io.Writer) bool

Aligned8Byte returns if all fields are aligned modulo 8-bytes.

Error messaging is printed to out for any fileds determined misaligned.

func NewTestError added in v0.2.3

func NewTestError(s string) error

Types

type Env added in v0.7.0

type Env struct {
	Name   string
	Value  string
	Exists bool
}

type EnvStore added in v0.7.0

type EnvStore interface {
	// Records the environment variable into the store.
	Record(key string)

	// Restore recovers the environment variables in the store.
	Restore() error
}

EnvStore stores and recovers environment variables.

func NewEnvStore added in v0.7.0

func NewEnvStore() EnvStore

func SetEnvVariables added in v0.7.0

func SetEnvVariables(env map[string]string) (EnvStore, error)

type FieldOffset

type FieldOffset struct {
	// Name of the field.
	Name string

	// Offset of the field in bytes.
	//
	// To compute this at compile time use unsafe.Offsetof.
	Offset uintptr
}

FieldOffset is a preprocessor representation of a struct field alignment.

type TestError added in v0.2.3

type TestError string

func (TestError) Error added in v0.2.3

func (e TestError) Error() string

Jump to

Keyboard shortcuts

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