mirror of
https://codeberg.org/scip/io-exporter.git
synced 2025-12-17 12:31:03 +01:00
Separate io tests to read and write mode with separate latencies (#2)
This commit is contained in:
16
cmd/alloc.go
16
cmd/alloc.go
@@ -1,6 +1,11 @@
|
||||
package cmd
|
||||
|
||||
import "github.com/ncw/directio"
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/ncw/directio"
|
||||
)
|
||||
|
||||
// aligned allocs used for testing
|
||||
type Alloc struct {
|
||||
@@ -25,3 +30,12 @@ func NewAlloc() *Alloc {
|
||||
readBlock: directio.AlignedBlock(directio.BlockSize),
|
||||
}
|
||||
}
|
||||
|
||||
func (alloc *Alloc) Compare() bool {
|
||||
// compare
|
||||
if !bytes.Equal(alloc.writeBlock, alloc.readBlock) {
|
||||
return report(errors.New("read not the same as written"), nil)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user