|
|
|
@ -52,12 +52,16 @@ func TestStrideTableInsert(t *testing.T) {
|
|
|
|
|
slow := slowTable[int]{pfxs}
|
|
|
|
|
fast := strideTable[int]{}
|
|
|
|
|
|
|
|
|
|
if debugStrideInsert {
|
|
|
|
|
t.Logf("slow table:\n%s", slow.String())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, pfx := range pfxs {
|
|
|
|
|
fast.insert(pfx.addr, pfx.len, pfx.val)
|
|
|
|
|
if debugStrideInsert {
|
|
|
|
|
t.Logf("after insert %d/%d:\n%s", pfx.addr, pfx.len, fast.tableDebugString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for i := 0; i < 256; i++ {
|
|
|
|
|
addr := uint8(i)
|
|
|
|
@ -122,12 +126,16 @@ func TestStrideTableDelete(t *testing.T) {
|
|
|
|
|
slow := slowTable[int]{pfxs}
|
|
|
|
|
fast := strideTable[int]{}
|
|
|
|
|
|
|
|
|
|
if debugStrideDelete {
|
|
|
|
|
t.Logf("slow table:\n%s", slow.String())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, pfx := range pfxs {
|
|
|
|
|
fast.insert(pfx.addr, pfx.len, pfx.val)
|
|
|
|
|
if debugStrideDelete {
|
|
|
|
|
t.Logf("after insert %d/%d:\n%s", pfx.addr, pfx.len, fast.tableDebugString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toDelete := pfxs[:50]
|
|
|
|
|
for _, pfx := range toDelete {
|
|
|
|
|