MCPcopy
hub / github.com/kopia/kopia / AssertInvalidOffsetLength

Function AssertInvalidOffsetLength

internal/blobtesting/asserts.go:92–101  ·  view source on GitHub ↗

AssertInvalidOffsetLength verifies that the given combination of (offset,length) fails on GetBlob().

(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID, offset, length int64)

Source from the content-addressed store, hash-verified

90
91// AssertInvalidOffsetLength verifies that the given combination of (offset,length) fails on GetBlob().
92func AssertInvalidOffsetLength(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID, offset, length int64) {
93 t.Helper()
94
95 var tmp gather.WriteBuffer
96 defer tmp.Close()
97
98 if err := s.GetBlob(ctx, blobID, offset, length, &tmp); err == nil {
99 t.Fatalf("GetBlob(%v,%v,%v) did not return error for invalid offset/length", blobID, offset, length)
100 }
101}
102
103// AssertGetBlobNotFound asserts that GetBlob() for specified blobID returns ErrNotFound.
104func AssertGetBlobNotFound(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID) {

Callers 1

AssertGetBlobFunction · 0.85

Calls 4

CloseMethod · 0.95
HelperMethod · 0.80
FatalfMethod · 0.80
GetBlobMethod · 0.65

Tested by

no test coverage detected