milvus/internal/querynode/cgo_helper_test.go
FluorineDog 9a90313390
Support GetEntityByIDs in CGo, fix segcore bugs (#5563)
Signed-off-by: fluorinedog <fluorinedog@gmail.com>
2021-06-04 10:38:34 +08:00

27 lines
562 B
Go

package querynode
import (
"testing"
"github.com/milvus-io/milvus/internal/proto/schemapb"
"github.com/stretchr/testify/assert"
)
func TestCGoHelper_Naive(t *testing.T) {
pb := schemapb.BoolArray{
Data: []bool{true, false, true, true, true},
}
cpb, err := MarshalForCGo(&pb)
assert.Nil(t, err)
// this function will accept a BoolArray input,
// and return a BoolArray output
// which negates all elements of the input
ba, err := TestBoolArray(cpb)
assert.Nil(t, err)
for index, b := range ba.Data {
assert.Equal(t, b, !pb.Data[index])
}
}