Add test for unique_ptr manual release

Signed-off-by: FluorineDog <guilin.gou@zilliz.com>
pull/4973/head^2
FluorineDog 2020-08-26 17:38:45 +08:00 committed by yefu.chen
parent 3c4a9f38b0
commit fc6e31c8b0
7 changed files with 59 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
#proxy
proxy/cmake_build
proxy/cmake-build-debug
proxy/thirdparty/grpc-src
proxy/thirdparty/grpc-build
.idea/

View File

@ -163,11 +163,12 @@ TEST(DogSegmentTest, MockTest) {
auto line_sizeof = (sizeof(int) + sizeof(float) * 16);
assert(raw_data.size() == line_sizeof * N);
auto segment = CreateSegment(schema);
auto segment = CreateSegment(schema).release();
DogDataChunk data_chunk{raw_data.data(), (int)line_sizeof, N};
segment->Insert(N, uids.data(), timestamps.data(), data_chunk);
QueryResult query_result;
segment->Query(nullptr, 0, query_result);
delete segment;
int i = 0;
i++;
}

View File

@ -72,6 +72,7 @@ define_option(MILVUS_WITH_OPENTRACING "Build with Opentracing" ON)
define_option(MILVUS_WITH_YAMLCPP "Build with yaml-cpp library" ON)
define_option(MILVUS_WITH_PULSAR "Build with pulsar-client" ON)
#----------------------------------------------------------------------
set_option_category("Test and benchmark")

View File

@ -10,6 +10,6 @@
// or implied. See the License for the specific language governing permissions and limitations under the License.
#define MILVUS_VERSION "0.10.0"
#define BUILD_TYPE "Release"
#define BUILD_TIME "2020-08-24 14:23.26"
#define LAST_COMMIT_ID "83d51fc3196e51a3057e1fb716ee4f4be10ec0c1"
#define BUILD_TYPE "Debug"
#define BUILD_TIME "2020-08-26 10:38.42"
#define LAST_COMMIT_ID "d4541146463566c35477391afb0573a57b00a94e"

View File

@ -52,3 +52,8 @@ if ( MILVUS_WITH_OPENTRACING )
add_subdirectory( opentracing )
endif()
# ****************************** Thirdparty pulsar-client-cpp ***************************************
if ( MILVUS_WITH_PULSAR )
add_subdirectory(pulsar-client-cpp)
endif()

View File

@ -0,0 +1,46 @@
#-------------------------------------------------------------------------------
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
#-------------------------------------------------------------------------------
if (DEFINED ENV{MILVUS_PULSAR_URL})
set(PULSAR_URL "$ENV{MILVUS_PULSAR_URL}")
else ()
set(PULSAR_URL
"https://github.com/apache/pulsar/archive/${PULSAR_CLIENT_CPP_VERSION}.zip")
endif ()
message(STATUS "Building pulsar-client-cpp-${PULSAR_CLIENT_CPP_VERSION} from source")
FetchContent_Declare(
pulsar
URL ${PULSAR_URL}
# URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8"
DOWNLOAD_DIR ${MILVUS_BINARY_DIR}/3rdparty_download/download
)
if (NOT pulsar_POPULATED)
FetchContent_Populate(pulsar)
# Adding the following targets:
# pulsar-client-cpp
add_subdirectory(${pulsar_SOURCE_DIR}/pulsar-client-cpp
${pulsar_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
#get_target_property( YAML_CPP_INCLUDE_DIR pulsar-client-cpp INTERFACE_INCLUDE_DIRECTORIES )
#message( STATUS ${YAML_CPP_INCLUDE_DIR} )
get_property(var DIRECTORY "${pulsar_SOURCE_DIR}/pulsar-client-cpp" PROPERTY COMPILE_OPTIONS)
message(STATUS "pulsar-client-cpp compile options: ${var}")

View File

@ -4,5 +4,5 @@ GRPC_VERSION=9a62f6e05d0be96df674d60a66f330a085ced095
YAMLCPP_VERSION=0.6.3
ZLIB_VERSION=v1.2.11
OPENTRACING_VERSION=v1.5.1
PULSAR_CLIENT_CPP_VERSION=v2.6.1
# vim: set filetype=sh: