mirror of https://github.com/tidwall/tile38.git
19 lines
269 B
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")
|
||
|
}
|
||
|
}
|