testpoint

package
v0.0.0-...-f2d3015 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertPacketsMatch

func AssertPacketsMatch(t *testing.T, actual []byte, expected []byte)

func ComparePackets

func ComparePackets(actual []byte, expected []byte) (mismatches int, lengthOk bool)

func MakeLogger

func MakeLogger(ctx model.SimContext, name string, flushDelay time.Duration) model.DataSinkBytes

func RandPacket

func RandPacket(r *rand.Rand) []byte

Types

type DataSink

type DataSink struct {
	component.NullEventSource
	Collected []byte
}

func MakeDataSink

func MakeDataSink(ctx model.SimContext) *DataSink

func (*DataSink) Take

func (ds *DataSink) Take() []byte

func (*DataSink) TryWrite

func (ds *DataSink) TryWrite(from []byte) int

type DataSource

type DataSource struct {
	*component.EventDispatcher
	Ready []byte
}

func MakeDataSource

func MakeDataSource(ctx model.SimContext, ready []byte) *DataSource

func (*DataSource) IsConsumed

func (ds *DataSource) IsConsumed() bool

func (*DataSource) Refill

func (ds *DataSource) Refill(data []byte)

func (*DataSource) TryRead

func (ds *DataSource) TryRead(into []byte) int

type Logger

type Logger struct {
	*component.EventDispatcher
	// contains filtered or unexported fields
}

func (*Logger) TryWrite

func (l *Logger) TryWrite(from []byte) int

Jump to

Keyboard shortcuts

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