Skip to content

Commit

Permalink
chore: rm unused test code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost committed Aug 21, 2024
1 parent 11d91db commit 4d09227
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cache/mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package mempool

import (
"runtime/debug"
"testing"
"unsafe"

Expand All @@ -44,8 +43,6 @@ func TestCap(t *testing.T) {
}

func TestAppend(t *testing.T) {
debug.SetGCPercent(-1) // make sure the buf in pools will not be recycled
defer debug.SetGCPercent(100) // reset to 100
str := "TestAppend"
b := Malloc(0)
for i := 0; i < 2000; i++ {
Expand Down Expand Up @@ -85,9 +82,11 @@ func TestFree(t *testing.T) {
func Benchmark_MallocFree(b *testing.B) {
b.ReportAllocs()
b.RunParallel(func(pb *testing.PB) {
i := 0
for pb.Next() {
b := Malloc(1)
b := Malloc(i & 0xffff)
Free(b)
i++
}
})
}
Expand Down

0 comments on commit 4d09227

Please sign in to comment.