2018-12-27 15:44:52 -08:00
|
|
|
package geohash
|
|
|
|
|
|
2021-04-06 22:24:58 -07:00
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"golang.org/x/sys/cpu"
|
|
|
|
|
)
|
2018-12-27 15:44:52 -08:00
|
|
|
|
|
|
|
|
//go:generate go run asm.go -out geohash.s -stubs stub.go
|
|
|
|
|
|
|
|
|
|
func TestEncodeIntMountEverest(t *testing.T) {
|
2021-04-06 22:24:58 -07:00
|
|
|
if !(cpu.X86.HasSSE2 && cpu.X86.HasBMI2) {
|
|
|
|
|
t.Skip("requires SSE2 and BMI2 instruction sets")
|
|
|
|
|
}
|
2018-12-27 15:44:52 -08:00
|
|
|
if EncodeInt(27.988056, 86.925278) != 0xceb7f254240fd612 {
|
|
|
|
|
t.Fail()
|
|
|
|
|
}
|
|
|
|
|
}
|