mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
Remove debug code (#11556)
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
b5bc9b26d7
commit
c5f566357a
@ -51,16 +51,3 @@ MetricTypeToName(MetricType metric_type) {
|
||||
}
|
||||
|
||||
} // namespace milvus
|
||||
|
||||
CProtoResult
|
||||
CTestBoolArrayPb(CProto pb) {
|
||||
milvus::proto::schema::BoolArray bool_array;
|
||||
bool_array.ParseFromArray(pb.proto_blob, pb.proto_size);
|
||||
// std::cout << pb.proto_size << std::endl;
|
||||
// std::cout << bool_array.DebugString() << std::endl;
|
||||
for (auto& b : *bool_array.mutable_data()) {
|
||||
b = !b;
|
||||
}
|
||||
// create bool proto
|
||||
return milvus::AllocCProtoResult(bool_array);
|
||||
}
|
||||
|
@ -58,9 +58,6 @@ typedef struct CProtoResult {
|
||||
CProto proto;
|
||||
} CProtoResult;
|
||||
|
||||
CProtoResult
|
||||
CTestBoolArrayPb(CProto pb);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -27,7 +27,6 @@ import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/proto/commonpb"
|
||||
"github.com/milvus-io/milvus/internal/proto/schemapb"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@ -95,14 +94,3 @@ func HandleCProtoResult(cRes *C.CProtoResult, msg proto.Message) error {
|
||||
defer C.free(cpro.proto_blob)
|
||||
return proto.Unmarshal(blob, msg)
|
||||
}
|
||||
|
||||
// TestBoolArray this function will accept a BoolArray input,
|
||||
// and return a BoolArray output
|
||||
// which negates all elements of the input
|
||||
func TestBoolArray(cpb *ProtoCGo) (*schemapb.BoolArray, error) {
|
||||
res := C.CTestBoolArrayPb(cpb.CProto)
|
||||
ba := new(schemapb.BoolArray)
|
||||
err := HandleCProtoResult(&res, ba)
|
||||
|
||||
return ba, err
|
||||
}
|
||||
|
@ -11,16 +11,6 @@ func TestCGoHelper_Naive(t *testing.T) {
|
||||
pb := schemapb.BoolArray{
|
||||
Data: []bool{true, false, true, true, true},
|
||||
}
|
||||
cpb, err := MarshalForCGo(&pb)
|
||||
_, 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])
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user