Separate io tests to read and write mode with separate latencies (#2)

This commit is contained in:
T.v.Dein
2025-10-22 18:02:26 +02:00
committed by GitHub
parent 8b3cf64e96
commit 5184c3a03e
6 changed files with 178 additions and 74 deletions

View File

@@ -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
}