Remove debug code (#11556)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
Cai Yudong 2021-11-10 17:31:37 +08:00 committed by GitHub
parent b5bc9b26d7
commit c5f566357a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 39 deletions

View File

@ -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);
}

View File

@ -58,9 +58,6 @@ typedef struct CProtoResult {
CProto proto;
} CProtoResult;
CProtoResult
CTestBoolArrayPb(CProto pb);
#ifdef __cplusplus
}
#endif

View File

@ -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
}

View File

@ -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])
}
}