Documentation ¶
Overview ¶
A test library for localblobstores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRetrieveAndDelete ¶
func AddRetrieveAndDelete(t *testing.T, ctx *context.T, bs localblobstore.BlobStore, testDirName string)
AddRetrieveAndDelete() tests adding, retrieving, and deleting blobs from a blobstore bs. One can't retrieve or delete something that hasn't been created, so it's all done in one routine. If testDirName is non-empty, the blobstore is assumed to be accessible in the file system, and its files are checked.
func CreateAndResume ¶
CreateAndResume() tests that it's possible to create a blob with NewBlobWriter(), immediately close it, and then resume writing with ResumeBlobWriter. This test is called out because syncbase does this, and it exposed a bug in the reader code, which could not cope with a request to read starting at the very end of a file, thus returning no bytes.
func WriteViaChunks ¶
WriteViaChunks() tests that a large blob in one blob store can be transmitted to another incrementally, without transferring chunks already in the other blob store.
Types ¶
type RandReader ¶
type RandReader struct {
// contains filtered or unexported fields
}
A RandReader contains a pointer to a rand.Read, and a size limit. Its pointers implement the Read() method from io.Reader, which yields bytes obtained from the random number generator.
func NewRandReader ¶
func NewRandReader(seed int64, limit int, insertInterval int, eofErr error) *RandReader
NewRandReader() returns a new RandReader with the specified seed and size limit. It yields eofErr when the end of the stream is reached. If insertInterval is non-zero, a zero byte is inserted into the stream every insertInterval bytes, before resuming getting bytes from the random number generator.