mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
9a90313390
Signed-off-by: fluorinedog <fluorinedog@gmail.com>
27 lines
562 B
Go
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])
|
|
}
|
|
}
|