mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
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])
|
||
|
}
|
||
|
}
|