tile38/vendor/github.com/tidwall/lotsa/lotsa_test.go

19 lines
269 B
Go

package lotsa
import (
"sync/atomic"
"testing"
)
func TestOps(t *testing.T) {
var threads = 4
var N = threads * 10000
var total int64
Ops(N, threads, func(i, thread int) {
atomic.AddInt64(&total, 1)
})
if total != int64(N) {
t.Fatal("invalid total")
}
}