milvus/proxy-go/proxy_node/util_test.go
shengjh 3d7181617b Add ci and format code for proxy
Signed-off-by: shengjh <1572099106@qq.com>
2020-10-15 16:32:22 +08:00

31 lines
446 B
Go

package proxy_node
import (
"github.com/stretchr/testify/assert"
"testing"
"unsafe"
)
func TestUint64(t *testing.T) {
var i int64 = -1
var u uint64 = uint64(i)
t.Log(i)
t.Log(u)
}
func TestHash32_Uint64(t *testing.T) {
var u uint64 = 0x12
h, err := Hash32_Uint64(u)
assert.Nil(t, err)
t.Log(h)
b := make([]byte, unsafe.Sizeof(u))
b[0] = 0x12
h2, err := Hash32_Bytes(b)
assert.Nil(t, err)
t.Log(h2)
assert.Equal(t, h, h2)
}