txqueue work

This commit is contained in:
soypat
2025-01-13 19:36:17 -03:00
parent 9abf0c11b9
commit 0a75ef4670
4 changed files with 56 additions and 9 deletions
+14
View File
@@ -172,6 +172,20 @@ func TestRing2(t *testing.T) {
}
}
func TestRingWriteLimited(t *testing.T) {
rng := rand.New(rand.NewSource(0))
const bufSize = 10
r := &Ring{
Buf: make([]byte, bufSize),
}
var data [bufSize]byte
for i := 0; i < 32; i++ {
n, _ := rng.Read(data[:rng.Intn(10)+1])
limoff := r.Off
r.WriteLimited()
}
}
func TestRing_findcrash(t *testing.T) {
const maxsize = 33
const ntests = 800000