pathdbtest

package
Version: v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocPathSegment

func AllocPathSegment(t *testing.T, ctrl *gomock.Controller, ifs []uint64,
	expiration uint32) (*seg.PathSegment, []byte)

func InsertSeg

func InsertSeg(t *testing.T, ctx context.Context, pathDB pathdb.ReadWrite,
	pseg *seg.PathSegment, hpCfgIDs []*query.HPCfgID) pathdb.InsertStats

func TestPathDB

func TestPathDB(t *testing.T, db TestablePathDB)

TestPathDB should be used to test any implementation of the PathDB interface. An implementation of the PathDB interface should at least have one test method that calls this test-suite.

Types

type TestablePathDB

type TestablePathDB interface {
	pathdb.PathDB
	// Prepare should reset the internal state so that the DB is empty and is
	// ready to be tested.
	Prepare(t *testing.T, ctx context.Context)
}

TestablePathDB extends the path db interface with methods that are needed for testing.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL