dbtest

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocPathSegment

func AllocPathSegment(t *testing.T, ifs []uint64, infoTS uint32) (*seg.PathSegment, []byte)

func InsertSeg

func InsertSeg(t *testing.T, ctx context.Context, pathDB pathdb.ReadWrite,
	pseg *seg.PathSegment, hpGroupIDs []uint64) 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.DB
	// 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.

Jump to

Keyboard shortcuts

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