提交 3ec555cf 编写于 作者: M mamingshuai

update openharmony 1.0.1

上级 2a3e429e
### 该问题是怎么引起的?
### 重现步骤
### 报错信息
### 相关的Issue
### 原因(目的、解决的问题等)
### 描述(做了什么,变更了什么)
### 测试用例(新增、改动、可能影响的功能)
# Copyright (c) 2020 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/build/suite_lite.gni")
import("//build/lite/config/subsystem/aafwk/config.gni")
lite_component("acts_compoment") {
all_features = []
features = []
if (ohos_xts_test_args != "") {
args = [
"--method_name", "get_target_modules",
"--arguments", "all_features=${ohos_xts_test_args}"
]
all_features += exec_script(rebase_path("//test/xts/tools/build/utils.py"), args, "list lines")
} else {
if(ohos_kernel_type == "liteos_m") {
all_features += [
"//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest",
"//test/xts/acts/communication_lite/softbus_hal:ActsSoftBusTest",
"//test/xts/acts/communication_lite/wifiservice_hal:ActsWifiServiceTest",
"//test/xts/acts/utils_lite/utilsfile_hal:ActsUtilsFileTest",
"//test/xts/acts/utils_lite/parameter_hal:ActsParameterTest",
"//test/xts/acts/iot_hardware_lite/wifiiot_hal:ActsWifiIotTest",
"//test/xts/acts/kernel_lite/kernelcmsis_hal:ActsCMSISTest",
"//test/xts/acts/hiviewdfx_lite/dfx_hal:ActsDfxFuncTest",
"//test/xts/acts/utils_lite/kvstore_hal:ActsKvStoreTest",
"//test/xts/acts/security_lite/datahuks_hal:ActsSecurityDataTest",
"//test/xts/acts/distributedschedule_lite/samgr_hal:ActsSamgrTest",
]
} else if(ohos_kernel_type == "liteos_a") {
all_features += [
"//test/xts/acts/kernel_lite:ActsKernelTest",
"//test/xts/acts/security_lite:securitytest",
"//test/xts/acts/utils_lite/kvstore_posix:ActsKvStoreTest",
"//test/xts/acts/startup_lite/parameter_posix:ActsParameterTest",
"//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
#"//test/xts/acts/multimedia_lite/multimedia_posix/camera:ActsMediaCameraTest",
"//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest",
"//test/xts/acts/distributedschedule_lite/samgr_posix:ActsSamgrTest",
#"//test/xts/acts/multimedia_lite/multimedia_posix/recorder:ActsMediaRecorderTest",
#"//test/xts/acts/uikit_lite:uikit_test",
"//test/xts/acts/appexecfwk_lite/bundlems_posix:ActsBundleMgrTest",
"//test/xts/acts/communication_lite/softbus_posix:ActsSoftBusTest",
"//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
]
if (enable_ohos_appexecfwk_feature_ability == true) {
all_features += [
"//test/xts/acts/appexecfwk_lite/abilityms_posix:ActsAbilityMgrTest",
]
}
} else if(ohos_kernel_type == "linux") {
all_features += [
"//test/xts/acts/utils_lite/kvstore_posix:ActsKvStoreTest",
"//test/xts/acts/startup_lite/parameter_posix:ActsParameterTest"
]
}
}
if (ohos_build_type == "debug") {
_all_features = ""
_product_json = rebase_path("//build/lite/product/${product}.json")
foreach(one_feature, all_features) {
_all_features = _all_features + one_feature + ","
}
_args = [
"--method_name", "filter_by_subsystem",
"--arguments", "testsuites=${_all_features}#product_json=${_product_json}"
]
features += exec_script(rebase_path("//test/xts/tools/build/utils.py"), _args, "list lines")
}
}
test_suite("acts") {
deps = [ ":acts_compoment" ]
version = "OpenHarmony-ACTS-1.11.0"
if (ohos_kernel_type == "liteos_a") {
deps += [ "//test/xts/tools/others/query:query" ]
copy("query_copy") {
sources = ["$root_out_dir/bin/query.bin"]
outputs = ["$root_out_dir/suites/acts/resource/tools/query.bin"]
}
}
}
generate_notice_file("acts_notice_file") {
module_name = "acts"
module_source_dir_list = [
"//third_party/googletest",
"//third_party/unity",
"//third_party/bounds_checking_function",
"//third_party/iniparser"
]
}
此差异已折叠。
此差异已折叠。
# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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.
group("ActsAiTest") {
deps = [ "//test/xts/acts/ai_lite/engine_posix/base:ActsAiEngineTest" ]
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/lite/build/suite_lite.gni")
lite_component("test_plugin_manager_so") {
target_type = "shared_library"
features =
[ "//foundation/ai/engine/services/server/plugin_manager:plugin_manager" ]
deps = [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//foundation/ai/engine/services/common/platform/dl_operation:dlOperation",
"//foundation/ai/engine/services/common/platform/lock:lock",
"//foundation/ai/engine/services/common/protocol/data_channel:data_channel",
]
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsAiEngineTest") {
suite_name = "acts"
sources = [
# Utils files
"src/utils/utils.cpp",
# AieClient Function Test Cases
"src/aie_client/AieClientAsyncProcessFunctionTest.cpp",
"src/aie_client/AieClientDestroyFunctionTest.cpp",
"src/aie_client/AieClientInitFunctionTest.cpp",
"src/aie_client/AieClientPrepareFunctionTest.cpp",
"src/aie_client/AieClientReleaseFunctionTest.cpp",
"src/aie_client/AieClientSetOptionFunctionTest.cpp",
"src/aie_client/AieClientSyncProcessFunctionTest.cpp",
# pluginManager Function Test Cases
"src/plugin_manager/PluginManagerFunctionTest.cpp",
]
include_dirs = [
"src",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog",
"//foundation/ai/engine/interfaces",
"//foundation/ai/engine/services/common",
"//foundation/ai/engine/services/client",
"//foundation/ai/engine/services/server",
"//foundation/ai/engine/services/algorithmsdk",
"//foundation/ai/engine/services/server/plugin",
"//third_party/bounds_checking_function/include",
"//utils/native/lite/include",
"//kernel/liteos-a/kernel/include",
"//kernel/liteos-a/kernel/common",
"//foundation/communication/ipc_lite/interfaces/kits",
"//foundation/communication/ipc_lite/frameworks/liteipc/include",
"//foundation/distributedschedule/samgr_lite/interfaces/innerkits/registry",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/registry",
"//foundation/distributedschedule/samgr_lite/interfaces/innerkits/samgr",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
]
deps = [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//foundation/ai/engine/services/client:client",
"//foundation/ai/engine/services/common/platform/dl_operation:dlOperation",
"//foundation/ai/engine/services/server/plugin_manager:plugin_manager",
"//foundation/ai/engine/test/sample:sample_plugin_1",
"//foundation/ai/engine/test/sample:sample_plugin_2",
"//foundation/distributedschedule/samgr_lite/samgr:samgr",
]
cflags = [ "-Wno-error" ]
ldflags = [ "-lstdc++" ]
}
{
"description": "Config for uikit uichart test cases",
"description": "Config for ai engine test cases",
"environment": [
{
"type": "device",
......@@ -12,14 +12,14 @@
"server": "NfsServer",
"mount": [
{
"source": "testcases/uikit",
"target": "/test_root/uikit"
"source": "testcases/ai",
"target": "/test_root/ai/engine"
}
]
}
],
"driver": {
"type": "CppTestLite",
"execute": "/test_root/uikit/ActsUIChartTest.bin"
"execute": "/test_root/ai/engine/ActsAiEngineTest.bin"
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "communication_adapter/include/sa_async_handler.h"
#include "communication_adapter/include/sa_client.h"
#include "platform/time/include/time.h"
#include "protocol/struct_definition/aie_info_define.h"
#include "server_executor/include/server_executor.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/aie_macros.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
namespace {
const int WAIT_CALLBACK_TIME_MS = 2000;
}
class AieClientAsyncProcessFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char *dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests AieClientAsyncProcess().
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* isAsyncProcessInputInfoNull Whether the input parameter InputInfo of AieClientAsyncProcess is null or not.
* isAsyncProcessSuccess Whether the expected result of AieClientAsyncProcess is successful or not.
* isExpectedAsyncProcessCbNotNull Whether the expected cb of AieClientAsyncProcess is not null or not.
*/
static void TestAieClientAsyncProcess(bool isAsync, bool isAsyncProcessInputInfoNull, bool isAsyncProcessSuccess,
bool isExpectedAsyncProcessCbNotNull)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
bool isPrepareInputInfoNull = GetRandomBool();
DataInfo prepareInputInfo = GetDataInfo(isPrepareInputInfoNull, INPUT_INFO_PREPARE);
DataInfo prepareOutputInfo = GetDataInfo();
ClientCallback *callback = nullptr;
if (isAsync) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, prepareInputInfo, prepareOutputInfo, callback);
EXPECT_EQ(RETCODE_SUCCESS, prepareReturnCode) << "AieClientPrepare is failed!";
EXPECT_EQ(true, prepareOutputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientAsyncProcess.
DataInfo asyncProcessInputInfo = GetDataInfo(isAsyncProcessInputInfoNull, INPUT_INFO_ASYNC_PROCESS);
int asyncProcessReturnCode = AieClientAsyncProcess(clientInfo, algorithmInfo, asyncProcessInputInfo);
EXPECT_EQ(isAsyncProcessSuccess, asyncProcessReturnCode == 0) << "AieClientAsyncProcess is failed!";
// Step 4: Sleeps.
StepSleepMs(WAIT_CALLBACK_TIME_MS);
// Step 5: Invokes AieClientRelease.
DataInfo releaseInputInfo = GetDataInfo(false, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
// Step 6: Invokes AieClientDestroy.
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
// Step 7: Deletes callback.
AIE_DELETE(cb);
AIE_DELETE(callback);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientAsyncProcess_01_0100
* @tc.name : 01. algorithmInfo中isAsync=true,inputInfo不为空,调用AieClientAsyncProcess返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientAsyncProcessFunctionTest, testAieClientAsyncProcessFunction0101, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientAsyncProcessFunction0101.");
TestAieClientAsyncProcess(true, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientAsyncProcess_01_0200
* @tc.name : 02. algorithmInfo中isAsync=true,inputInfo为空,调用AieClientAsyncProcess返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientAsyncProcessFunctionTest, testAieClientAsyncProcessFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientAsyncProcessFunction0102.");
TestAieClientAsyncProcess(true, true, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientAsyncProcess_02_0100
* @tc.name : 01. algorithmInfo中isAsync=false,调用AieClientAsyncProcess返回失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientAsyncProcessFunctionTest, testAieClientAsyncProcessFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientAsyncProcessFunction0201.");
bool isAsyncProcessInputInfoNull = GetRandomBool();
TestAieClientAsyncProcess(false, isAsyncProcessInputInfoNull, false, false);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "protocol/struct_definition/aie_info_define.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
class AieClientDestroyFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char* dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests AieClientDestroy. Invoke sequence: AieClientInit-AieClientPrepare-AieClientSyncProcess/AieClientAsyncProcess
* -AieClientRelease-AieClientDestroy.
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
*/
static void TestAieClientDestroy(bool isAsync)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
bool isPrepareInputInfoNull = GetRandomBool();
DataInfo prepareInputInfo = GetDataInfo(isPrepareInputInfoNull, INPUT_INFO_PREPARE);
DataInfo prepareOutputInfo = GetDataInfo();
IClientCb *callback = nullptr;
if (isAsync) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, prepareInputInfo, prepareOutputInfo, callback);
EXPECT_EQ(RETCODE_SUCCESS, prepareReturnCode) << "AieClientPrepare is failed!";
EXPECT_EQ(true, prepareOutputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientSyncProcess/AieClientAsyncProcess.
bool isProcessInputInfoNull = GetRandomBool();
if (isAsync) {
DataInfo asyncProcessInputInfo = GetDataInfo(isProcessInputInfoNull, INPUT_INFO_ASYNC_PROCESS);
int asyncProcessReturnCode = AieClientAsyncProcess(clientInfo, algorithmInfo, asyncProcessInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, asyncProcessReturnCode) << "AieClientAsyncProcess is failed!";
} else {
DataInfo syncProcessInputInfo = GetDataInfo(isProcessInputInfoNull, INPUT_INFO_SYNC_PROCESS);
DataInfo syncProcessOutputInfo = GetDataInfo();
int syncProcessReturnCode = AieClientSyncProcess(clientInfo, algorithmInfo, syncProcessInputInfo,
syncProcessOutputInfo);
EXPECT_EQ(RETCODE_SUCCESS, syncProcessReturnCode) << "AieClientSyncProcess is failed!";
EXPECT_EQ(true, syncProcessOutputInfo.data != nullptr) << "AieClientSyncProcess outputInfo is incorrect!";
}
// Step 4: Invokes AieClientRelease.
bool isReleaseInputInfoNull = GetRandomBool();
DataInfo releaseInputInfo = GetDataInfo(isReleaseInputInfoNull, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
// Step 5: Invokes AieClientDestroy.
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
// Step 6: Deletes callback.
AIE_DELETE(cb);
if (isAsync) {
AIE_DELETE(callback);
}
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientDestroy_0100
* @tc.name : 01. 初始化之后,调用AieClientDestroy返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientDestroyFunctionTest, testAieClientDestroyFunction001, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientDestroyFunction001.");
bool isAsync = GetRandomBool();
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
AIE_DELETE(cb);
// Step 2: Invokes AieClientDestroy.
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientDestroy_0200
* @tc.name : 02. 同步执行算法之后,调用AieClientDestroy返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientDestroyFunctionTest, testAieClientDestroyFunction002, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientDestroyFunction002.");
TestAieClientDestroy(false);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientDestroy_0300
* @tc.name : 03. 异步执行算法之后,调用AieClientDestroy返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientDestroyFunctionTest, testAieClientDestroyFunction003, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientDestroyFunction003.");
TestAieClientDestroy(true);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <string>
#include "client_executor/include/i_aie_client.inl"
#include "utils/aie_client_const.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
namespace {
const int DESCRIPTION_LENGTH_20 = 21;
const int DESCRIPTION_LENGTH_128 = 129;
}
class AieClientInitFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo, const char *description)
{
configInfo = {.description = description};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Tests AieClientInit.
*
* configDesc The value or the input parameter ConfigInfo.description of AieClientInit.
* isAsync The value or the input parameter AlgorithmInfo.isAsync of AieClientInit.
* bool isDeadCbNotNull Whether the dead callback parameter is not null.
*/
static void TestAieClientInit(const char *configDesc, bool isAsync, bool isDeadCbNotNull)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo, configDesc);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
if (isDeadCbNotNull) {
AIE_NEW(cb, ServiceDeadCb());
}
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invoke AieClientDestroy().
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
AIE_DELETE(cb);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_configInfo_0100
* @tc.name : 01. configInfo中的description设置为20位字符串,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0101, Function | MediumTest | Level1)
{
HILOGI("[Test]testAieClientInitFunction0101.");
char configDesc[DESCRIPTION_LENGTH_20];
GetRandomString(DESCRIPTION_LENGTH_20, configDesc);
bool isAsync = GetRandomBool();
TestAieClientInit(configDesc, isAsync, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_configInfo_0200
* @tc.name : 02. configInfo中的description设置为128位字符串,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientInitFunction0102.");
char configDesc[DESCRIPTION_LENGTH_128];
GetRandomString(DESCRIPTION_LENGTH_128, configDesc);
bool isAsync = GetRandomBool();
TestAieClientInit(configDesc, isAsync, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_configInfo_0300
* @tc.name : 03. configInfo中的description设置为空,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0103, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientInitFunction0103.");
const char* configDesc = "";
bool isAsync = GetRandomBool();
TestAieClientInit(configDesc, isAsync, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_algorithmInfo_0100
* @tc.name : 01. algorithmInfo中isAsync=false,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientInitFunction0201.");
TestAieClientInit(CONFIG_DESCRIPTION, false, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_algorithmInfo_0200
* @tc.name : 02. algorithmInfo中isAsync=true,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0202, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientInitFunction0202.");
TestAieClientInit(CONFIG_DESCRIPTION, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientInit_cb_0100
* @tc.name : 01. cb=空,调用AieClientInit返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientInitFunctionTest, testAieClientInitFunction0301, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientInitFunction0301.");
bool isAsync = GetRandomBool();
TestAieClientInit(CONFIG_DESCRIPTION, isAsync, false);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "protocol/retcode_inner/aie_retcode_inner.h"
#include "server_executor/include/server_executor.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/aie_macros.h"
#include "utils/constants/constants.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
class AieClientPrepareFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char *dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests the input parameters algorithmInfo and inputInfo in AieClientPrepare().
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* isPrepareInputInfoNull Whether the input parameter InputInfo of AieClientPrepare is null or not.
* isPrepareCbNull Whether the cb input parameter cb of AieClientPrepare is null or not.
* isPrepareSuccess Whether the expected result of AieClientPrepare is successful or not.
* isOutputInfoDataCorrect Whether the expected OutputInfoData of AieClientPrepare is correct or not.
*/
static void TestAieClientPrepare(bool isAsync, bool isPrepareInputInfoNull, bool isPrepareCbNull,
bool isPrepareSuccess, bool isOutputInfoDataCorrect)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
DataInfo inputInfo = {
.data = nullptr,
.length = 0,
};
if (!isPrepareInputInfoNull) {
const char *str = INPUT_INFO_PREPARE;
char *inputData = const_cast<char*>(str);
int length = strlen(str) + 1;
inputInfo = {
.data = (unsigned char *) inputData,
.length = length,
};
}
DataInfo outputInfo = {
.data = nullptr,
.length = 0,
};
ClientCallback *callback = nullptr;
if (!isPrepareCbNull) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, inputInfo, outputInfo, callback);
EXPECT_EQ(isPrepareSuccess, prepareReturnCode == RETCODE_SUCCESS) << "AieClientPrepare is failed!";
EXPECT_EQ(isOutputInfoDataCorrect, outputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientRelease.
if (prepareReturnCode == RETCODE_SUCCESS) {
DataInfo releaseInputInfo = GetDataInfo(false, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
}
// Step 4: Invokes AieClientDestroy.
if (initReturnCode == RETCODE_SUCCESS) {
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
}
// Step 5: Deletes callback.
AIE_DELETE(cb);
if (!isPrepareCbNull) {
AIE_DELETE(callback);
}
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Sync_0100
* @tc.name : 01. algorithmInfo中isAsync=false,inputInfo不为空,cb为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0101, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientPrepareFunction0101.");
TestAieClientPrepare(false, false, true, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Sync_0200
* @tc.name : 02. algorithmInfo中isAsync=false,inputInfo为空,cb为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0102.");
TestAieClientPrepare(false, true, true, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Sync_0300
* @tc.name : 03. algorithmInfo中isAsync=false,inputInfo不为空,cb不为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0103, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0103.");
TestAieClientPrepare(false, false, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Sync_0400
* @tc.name : 04. algorithmInfo中isAsync=false,inputInfo为空,cb不为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0104, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0104.");
TestAieClientPrepare(false, true, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Async_0100
* @tc.name : 01. algorithmInfo中isAsync=true,inputInfo不为空,cb不为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0201.");
TestAieClientPrepare(true, false, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Async_0200
* @tc.name : 02. algorithmInfo中isAsync=true,inputInfo为空,cb不为空,调用AieClientPrepare返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0202, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0202.");
TestAieClientPrepare(true, true, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Async_0300
* @tc.name : 03. algorithmInfo中isAsync=true,inputInfo不为空,cb为空,调用AieClientPrepare返回失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0203, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0203.");
TestAieClientPrepare(true, false, true, false, false);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientPrepare_Async_0400
* @tc.name : 04. algorithmInfo中isAsync=true,inputInfo为空,cb为空,调用AieClientPrepare返回失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientPrepareFunctionTest, testAieClientPrepareFunction0204, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientPrepareFunction0204.");
TestAieClientPrepare(true, true, true, false, false);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "protocol/struct_definition/aie_info_define.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
class AieClientReleaseFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char* dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests AieClientRelease.
* Invoke sequence: AieClientInit-AieClientPrepare-AieClientSyncProcess/AieClientAsyncProcess-AieClientRelease.
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* isPerformProcess Whether to invoke AieClientSyncProcess/AieClientAsyncProcess or not.
*/
static void TestAieClientRelease(bool isAsync, bool isPerformProcess)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
bool isPrepareInputInfoNull = GetRandomBool();
DataInfo prepareInputInfo = GetDataInfo(isPrepareInputInfoNull, INPUT_INFO_PREPARE);
DataInfo prepareOutputInfo = GetDataInfo();
IClientCb *callback = nullptr;
if (isAsync) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, prepareInputInfo, prepareOutputInfo, callback);
EXPECT_EQ(RETCODE_SUCCESS, prepareReturnCode) << "AieClientPrepare is failed!";
EXPECT_EQ(true, prepareOutputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientSyncProcess/AieClientAsyncProcess.
bool isProcessInputInfoNull = GetRandomBool();
if (isPerformProcess) {
if (isAsync) {
DataInfo asyncProcessInputInfo = GetDataInfo(isProcessInputInfoNull, INPUT_INFO_ASYNC_PROCESS);
int asyncProcessReturnCode = AieClientAsyncProcess(clientInfo, algorithmInfo, asyncProcessInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, asyncProcessReturnCode) << "AieClientAsyncProcess is failed!";
} else {
DataInfo syncProcessInputInfo = GetDataInfo(isProcessInputInfoNull, INPUT_INFO_SYNC_PROCESS);
DataInfo syncProcessOutputInfo = GetDataInfo();
int syncProcessReturnCode = AieClientSyncProcess(clientInfo, algorithmInfo, syncProcessInputInfo,
syncProcessOutputInfo);
EXPECT_EQ(0, syncProcessReturnCode) << "AieClientSyncProcess is failed!";
EXPECT_EQ(true, syncProcessOutputInfo.data != nullptr) << "AieClientSyncProcess outputInfo is "
"incorrect!";
}
}
// Step 4: Invokes AieClientRelease.
bool isReleaseInputInfoNull = GetRandomBool();
DataInfo releaseInputInfo = GetDataInfo(isReleaseInputInfoNull, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
// Step 5: Invoke AieClientDestroy().
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
// Step 6: Deletes callback.
AIE_DELETE(cb);
if (isAsync) {
AIE_DELETE(callback);
}
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientRelease_0100
* @tc.name : 01. algorithmInfo中isAsync=false,不执行算法,调用AieClientRelease返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientReleaseFunctionTest, testAieClientReleaseFunction001, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientReleaseFunction001.");
TestAieClientRelease(false, false);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientRelease_0200
* @tc.name : 02. algorithmInfo中isAsync=true,不执行算法,调用AieClientRelease返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientReleaseFunctionTest, testAieClientReleaseFunction002, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientReleaseFunction002.");
TestAieClientRelease(true, false);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientRelease_0300
* @tc.name : 03. 同步执行算法之后,调用AieClientRelease返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientReleaseFunctionTest, testAieClientReleaseFunction003, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientReleaseFunction003.");
TestAieClientRelease(false, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientRelease_0400
* @tc.name : 04. 异步执行算法之后,调用AieClientRelease返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientReleaseFunctionTest, testAieClientReleaseFunction004, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientReleaseFunction004.");
TestAieClientRelease(true, true);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "protocol/retcode_inner/aie_retcode_inner.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/aie_macros.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
namespace {
const int g_setGetFirst = 1;
const int g_setGetSecond = 2;
const int g_setGetThird = 3;
const int INT_LENGTH = 65535;
}
class AieClientSetOptionFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(INT_LENGTH),
.requestId = GetRandomInt(INT_LENGTH),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char* dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests TestAieClientSetOption.
* Invoke sequence: AieClientInit-AieClientPrepare-AieClientSetOption-AieClientGetOption.
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* setAndGetTimes The attempts for invoking AieClientSetOption and AieClientGetOption.
*/
static void TestAieClientSetOption(bool isAsync, int setAndGetTimes)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
bool isPrepareInputInfoNull = GetRandomBool();
DataInfo prepareInputInfo = GetDataInfo(isPrepareInputInfoNull, INPUT_INFO_PREPARE);
DataInfo prepareOutputInfo = GetDataInfo();
IClientCb *callback = nullptr;
if (isAsync) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, prepareInputInfo, prepareOutputInfo, callback);
EXPECT_EQ(RETCODE_SUCCESS, prepareReturnCode) << "AieClientPrepare is failed!";
EXPECT_EQ(true, prepareOutputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientSetOption and AieClientGetOption.
int optionType = GetRandomInt(INT_LENGTH);
for (int i = 0; i < setAndGetTimes; i++) {
// Step 3.1: Invokes AieClientSetOption.
std::string setOptionString = std::string(INPUT_INFO_SET_OPTION) + "_" + std::to_string(i + 1);
char *setOptionInputData = const_cast<char*>(setOptionString.c_str());
int setOptionLength = strlen(setOptionInputData) + 1;
DataInfo setOptionInputInfo = {
.data = (unsigned char*)setOptionInputData,
.length = setOptionLength,
};
int setOptionReturnCode = AieClientSetOption(clientInfo, optionType, setOptionInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, setOptionReturnCode) << "AieClientSetOption is failed!";
// Step 3.2: Invokes AieClientGetOption.
bool isGetOptionInputInfoNull = GetRandomBool();
DataInfo getOptionInputInfo = GetDataInfo(isGetOptionInputInfoNull, INPUT_INFO_GET_OPTION);
DataInfo getOptionOutputInfo = GetDataInfo();
int getOptionReturnCode = AieClientGetOption(clientInfo, optionType, getOptionInputInfo, getOptionOutputInfo);
EXPECT_EQ(RETCODE_SUCCESS, getOptionReturnCode) << "AieClientSetOption is failed!";
std::string setOptionInputDataToString = "";
setOptionInputDataToString.append(reinterpret_cast<const char*>(setOptionInputInfo.data));
std::string getOptionOutputInfoToString = "";
getOptionOutputInfoToString.append(reinterpret_cast<const char*>(getOptionOutputInfo.data));
EXPECT_EQ(setOptionInputDataToString, getOptionOutputInfoToString) << "GetOption outputInfo is incorrect!";
}
// Step 4: Invokes AieClientRelease.
if (prepareReturnCode == RETCODE_SUCCESS) {
bool isReleaseInputInfoNull = GetRandomBool();
DataInfo releaseInputInfo = GetDataInfo(isReleaseInputInfoNull, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
}
// Step5: Invoke AieClientDestroy().
if (initReturnCode == RETCODE_SUCCESS) {
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
}
// Step 6: Deletes callback.
AIE_DELETE(cb);
AIE_DELETE(callback);
}
/**
* Tests TestAieClientSetOption.
* Invoke sequence: AieClientInit-AieClientSetOption-AieClientGetOption.
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* isPerformSetOption Whether to invoke AieClientSetOption or not.
*/
static void TestAieClientSetOptionWithoutPrepare(bool isAsync, bool isPerformSetOption)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 3: Invokes AieClientSetOption.
int optionType = 1;
if (isPerformSetOption) {
const char *setOptionString = INPUT_INFO_SET_OPTION;
char *setOptionInputData = const_cast<char*>(setOptionString);
int setOptionLength = strlen(setOptionString) + 1;
DataInfo inputInfo2 = {
.data = (unsigned char*)setOptionInputData,
.length = setOptionLength,
};
int setOptionReturnCode = AieClientSetOption(clientInfo, optionType, inputInfo2);
EXPECT_EQ(true, setOptionReturnCode != RETCODE_SUCCESS) << "AieClientSetOption is failed!";
}
// Step 4: Invokes AieClientGetOption.
bool isGetOptionInputInfoNull = GetRandomBool();
DataInfo getOptionInputInfo = GetDataInfo(isGetOptionInputInfoNull, INPUT_INFO_GET_OPTION);
DataInfo getOptionOutputInfo = GetDataInfo();
int getOptionReturnCode = AieClientGetOption(clientInfo, optionType, getOptionInputInfo, getOptionOutputInfo);
EXPECT_EQ(true, getOptionReturnCode != RETCODE_SUCCESS) << "AieClientSetOption is failed!";
EXPECT_EQ(true, getOptionOutputInfo.data == nullptr) << "GetOption outputInfo is incorrect!";
// Step5: Invoke AieClientDestroy().
if (initReturnCode == RETCODE_SUCCESS) {
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
}
// Step 6: Deletes callback.
AIE_DELETE(cb);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSetOption_01_0100
* @tc.name : 01. 加载算法插件之后,执行1次设置参数值和获取参数值,成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSetOptionFunctionTest, testAieClientSetOptionFunction0101, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientSetOptionFunction0101.");
bool isAsync = GetRandomBool();
TestAieClientSetOption(isAsync, g_setGetFirst);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSetOption_01_0200
* @tc.name : 02. 加载算法插件之后,执行2次设置参数值和获取参数值,成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSetOptionFunctionTest, testAieClientSetOptionFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSetOptionFunction0102.");
bool isAsync = GetRandomBool();
TestAieClientSetOption(isAsync, g_setGetSecond);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSetOption_01_0300
* @tc.name : 03. 加载算法插件之后,执行3次设置参数值和获取参数值,成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSetOptionFunctionTest, testAieClientSetOptionFunction0103, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSetOptionFunction0103.");
bool isAsync = GetRandomBool();
TestAieClientSetOption(isAsync, g_setGetThird);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSetOption_02_0100
* @tc.name : 01. 不加载算法插件,设置参数值,获取参数值,失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSetOptionFunctionTest, testAieClientSetOptionFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSetOptionFunction0201.");
bool isAsync = GetRandomBool();
TestAieClientSetOptionWithoutPrepare(isAsync, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSetOption_02_0200
* @tc.name : 02. 不加载算法插件,获取参数值,失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSetOptionFunctionTest, testAieClientSetOptionFunction0202, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSetOptionFunction0202.");
bool isAsync = GetRandomBool();
TestAieClientSetOptionWithoutPrepare(isAsync, false);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "client_executor/include/i_aie_client.inl"
#include "platform/time/include/time.h"
#include "utils/aie_client_callback.h"
#include "utils/aie_client_const.h"
#include "utils/log/aie_log.h"
#include "utils/service_dead_cb.h"
#include "utils/utils.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
namespace {
const int WAIT_CALLBACK_TIME_MS = 2000;
}
class AieClientSyncProcessFunctionTest : public testing::Test {};
/**
* Constructs ConfigInfo parameters.
*/
static void GetConfigInfo(ConfigInfo &configInfo)
{
configInfo = {.description = CONFIG_DESCRIPTION};
}
/**
* Constructs ClientInfo parameters.
*/
static void GetClientInfo(ClientInfo &clientInfo)
{
const char *str = CLIENT_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int len = strlen(str) + 1;
clientInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.clientId = INVALID_CLIENT_ID,
.sessionId = INVALID_SESSION_ID,
.extendLen = len,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs AlgorithmInfo parameters.
*/
static void GetSyncAlgorithmInfo(AlgorithmInfo &algorithmInfo, bool isAsync, int algorithmType)
{
const char *str = ALGORITHM_EXTEND_MSG;
char *extendMsg = const_cast<char*>(str);
int extendLen = strlen(str) + 1;
algorithmInfo = {
.clientVersion = CLIENT_VERSION_VALID,
.isAsync = isAsync,
.algorithmType = algorithmType,
.algorithmVersion = ALGORITHM_VERSION_VALID,
.isCloud = GetRandomBool(),
.operateId = GetRandomInt(65535),
.requestId = GetRandomInt(65535),
.extendLen = extendLen,
.extendMsg = (unsigned char*)extendMsg,
};
}
/**
* Constructs DataInfo.
*/
static DataInfo GetDataInfo(bool isDataInfoNull = true, const char* dataString = DATA_INFO_DEFAULT)
{
// Sets default dataInfo to null.
DataInfo dataInfo = {
.data = nullptr,
.length = 0,
};
// Sets dataInfo to specified value.
if (!isDataInfoNull) {
const char *str = dataString;
char *data = const_cast<char*>(str);
int length = strlen(str) + 1;
dataInfo = {
.data = reinterpret_cast<unsigned char *>(data),
.length = length,
};
}
return dataInfo;
}
/**
* Tests AieClientSyncProcess().
*
* isAsync The value of the input parameter AlgorithmInfo.isAsync of AieClientInit.
* isSyncProcessInputInfoNull Whether the input parameter InputInfo of AieClientSyncProcess is null or not.
* isSyncProcessSuccess Whether the expected result of AieClientSyncProcess is successful or not.
* isExpectedSyncProcessOutputInfoNotNull Whether the expected cb of AieClientSyncProcess is not null or not.
*/
static void TestAieClientSyncProcess(bool isAsync, bool isSyncProcessInputInfoNull, bool isSyncProcessSuccess,
bool isExpectedSyncProcessOutputInfoNotNull)
{
// Step 0: Defines variables.
ConfigInfo configInfo;
GetConfigInfo(configInfo);
ClientInfo clientInfo;
GetClientInfo(clientInfo);
AlgorithmInfo algorithmInfo;
int algorithmType = isAsync ? ALGORITHM_TYPE_ASYNC : ALGORITHM_TYPE_SYNC;
GetSyncAlgorithmInfo(algorithmInfo, isAsync, algorithmType);
ServiceDeadCb *cb = nullptr;
AIE_NEW(cb, ServiceDeadCb());
// Step 1: Invokes AieClientInit.
int initReturnCode = AieClientInit(configInfo, clientInfo, algorithmInfo, cb);
EXPECT_EQ(RETCODE_SUCCESS, initReturnCode) << "AieClientInit is failed!";
EXPECT_EQ(true, clientInfo.clientId > 0) << "clientId(" << std::to_string(clientInfo.clientId) << ") is incorrect!";
EXPECT_EQ(true, clientInfo.sessionId > 0) << "sessionId(" << std::to_string(clientInfo.sessionId)
<< ") is incorrect!";
// Step 2: Invokes AieClientPrepare.
bool isPrepareInputInfoNull = GetRandomBool();
DataInfo prepareInputInfo = GetDataInfo(isPrepareInputInfoNull, INPUT_INFO_PREPARE);
DataInfo prepareOutputInfo = GetDataInfo();
ClientCallback *callback = nullptr;
if (isAsync) {
AIE_NEW(callback, ClientCallback());
}
int prepareReturnCode = AieClientPrepare(clientInfo, algorithmInfo, prepareInputInfo, prepareOutputInfo, callback);
EXPECT_EQ(RETCODE_SUCCESS, prepareReturnCode) << "AieClientPrepare is failed!";
EXPECT_EQ(true, prepareOutputInfo.data != nullptr) << "Prepare outputInfo is incorrect!";
// Step 3: Invokes AieClientSyncProcess.
DataInfo syncProcessInputInfo = GetDataInfo(isSyncProcessInputInfoNull, INPUT_INFO_SYNC_PROCESS);
DataInfo syncProcessOutputInfo = GetDataInfo();
int syncProcessReturnCode = AieClientSyncProcess(clientInfo, algorithmInfo, syncProcessInputInfo,
syncProcessOutputInfo);
EXPECT_EQ(isSyncProcessSuccess, syncProcessReturnCode == RETCODE_SUCCESS) << "AieClientSyncProcess is failed!";
EXPECT_EQ(isExpectedSyncProcessOutputInfoNotNull, syncProcessOutputInfo.data != nullptr)
<< "AieClientSyncProcess outputInfo is incorrect!";
// Step 4: Sleeps.
StepSleepMs(WAIT_CALLBACK_TIME_MS);
// Step 5: Invokes AieClientRelease.
DataInfo releaseInputInfo = GetDataInfo(false, INPUT_INFO_RELEASE);
int releaseReturnCode = AieClientRelease(clientInfo, algorithmInfo, releaseInputInfo);
EXPECT_EQ(RETCODE_SUCCESS, releaseReturnCode) << "AieClientRelease is failed!";
// Step 6: Invokes AieClientDestroy.
int destroyReturnCode = AieClientDestroy(clientInfo);
EXPECT_EQ(RETCODE_SUCCESS, destroyReturnCode) << "AieClientDestroy is failed!";
// Step 7: Deletes callback.
AIE_DELETE(cb);
AIE_DELETE(callback);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSyncProcess_01_0100
* @tc.name : 01. algorithmInfo中isAsync=false,inputInfo不为空,调用AieClientSyncProcess返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSyncProcessFunctionTest, testAieClientSyncProcessFunction0101, Function | MediumTest | Level2)
{
HILOGI("[Test]testAieClientSyncProcessFunction0101.");
TestAieClientSyncProcess(false, false, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSyncProcess_01_0200
* @tc.name : 02 algorithmInfo中isAsync=false,inputInfo为空,调用AieClientSyncProcess返回成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSyncProcessFunctionTest, testAieClientSyncProcessFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSyncProcessFunction0102.");
TestAieClientSyncProcess(false, true, true, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiAPI_AIEClient_AieClientSyncProcess_02_0100
* @tc.name : 01. algorithmInfo中isAsync=true,调用AieClientSyncProcess返回失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AieClientSyncProcessFunctionTest, testAieClientSyncProcessFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testAieClientSyncProcessFunction0201.");
bool isSyncProcessInputInfoNull = GetRandomBool();
TestAieClientSyncProcess(true, isSyncProcessInputInfoNull, false, false);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include "gtest/gtest.h"
#include <cstring>
#include <unistd.h>
#include "plugin_manager/include/aie_plugin_info.h"
#include "plugin_manager/include/i_plugin_manager.h"
#include "utils/aie_client_const.h"
#include "utils/log/aie_log.h"
using namespace ::testing;
using namespace testing::ext;
using namespace OHOS::AI;
namespace {
std::string AID_DEMO_PLUGIN_SYNC = "sample_plugin_1"; // defined by ALGORITHM_ID_SAMPLE_1 in aie_plugin_info.h
std::string AID_DEMO_PLUGIN_ASYNC = "sample_plugin_2"; // defined by ALGORITHM_ID_SAMPLE_2 in aie_plugin_info.h
std::string AID_PLUGIN_INVALID = "invalid_plugin";
}
class PluginManagerFunctionTest : public testing::Test {};
static void TestPluginManager(std::string aid, bool isExceptedLoadPluginSuccess)
{
// Step 1: Create an instance.
IPluginManager *pluginManager = IPluginManager::GetPluginManager();
// Step 2: Invoke pluginManager->GetPlugin.
long long version = ALGORITHM_VERSION_VALID;
std::shared_ptr<Plugin> plugin = nullptr;
int ret = pluginManager->GetPlugin(aid, version, plugin);
HILOGE("[Test]ret is %d.", ret);
EXPECT_EQ(isExceptedLoadPluginSuccess, plugin != nullptr) << "pluginManager->GetPlugin test failed.";
if (plugin != nullptr) {
const char *name = plugin->GetPluginAlgorithm()->GetName();
HILOGD("[Test]The plugin name [%s].", name);
EXPECT_EQ(isExceptedLoadPluginSuccess, name != nullptr) << "Get plugin name failed.";
}
// Step 3: Unload the plugin.
pluginManager->UnloadPlugin(aid, version);
// Step 4: Destroy the plugin.
pluginManager->Destroy();
}
static void TestPluginManagerUnloadPlugin(std::string aid)
{
bool isPass = false;
long long version = ALGORITHM_VERSION_VALID;
IPluginManager *pluginManager2 = IPluginManager::GetPluginManager();
pluginManager2->UnloadPlugin(aid, version);
isPass = true;
EXPECT_EQ(true, isPass) << "UnloadPlugin test failed.";
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_1100
* @tc.name : 011. 系统中已预置算法插件(同步),加载、卸载插件成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0101, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0101.");
TestPluginManager(AID_DEMO_PLUGIN_SYNC, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_1200
* @tc.name : 012. 系统中已预置算法插件(异步),加载、卸载插件成功
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0102, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0102.");
TestPluginManager(AID_DEMO_PLUGIN_ASYNC, true);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_1300
* @tc.name : 013. 系统中未预置插件,加载插件失败
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0103, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0103.");
TestPluginManager(AID_PLUGIN_INVALID, false);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_2100
* @tc.name : 021. 系统中已预置算法插件(同步),不加载插件,直接卸载插件,不发生crash
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0201, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0201.");
TestPluginManagerUnloadPlugin(AID_DEMO_PLUGIN_SYNC);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_2200
* @tc.name : 022. 系统中已预置算法插件(异步),不加载插件,直接卸载插件,不发生crash
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0202, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0202.");
TestPluginManagerUnloadPlugin(AID_DEMO_PLUGIN_ASYNC);
}
/**
* @tc.number : SUB_AI_AIDistributedAbility_HiAiEngine_Lite_Function_HiAiSupportPlugin_2300
* @tc.name : 023. 系统中未预置插件,不加载插件,直接卸载插件,不发生crash
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PluginManagerFunctionTest, testPluginManagerFunction0203, Function | MediumTest | Level3)
{
HILOGI("[Test]testPluginManagerFunction0203.");
TestPluginManagerUnloadPlugin(AID_PLUGIN_INVALID);
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#ifndef AIE_CLIENT_CALLBACK_H
#define AIE_CLIENT_CALLBACK_H
#include "client_executor/include/i_client_cb.h"
#include "utils/log/aie_log.h"
/**
* Defines a callback function which is used to define the input parameter of AieClientPrepare().
*/
class ClientCallback : public OHOS::AI::IClientCb {
public:
ClientCallback() = default;
~ClientCallback() override = default;
void OnResult(const DataInfo &result, int resultCode, int requestId)
{
HILOGI("\n[Test]ClientCallbackOnResult is executed."\
" resultCode[%d], requestId[%d], resultData[%s], resultLength[%d].",
resultCode, requestId, result.data, result.length);
EXPECT_EQ(0, resultCode) << "ClientCallback is failed!";
}
};
#endif // AIE_CLIENT_CALLBACK_H
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#ifndef AIE_CLIENT_CONST_H
#define AIE_CLIENT_CONST_H
#include <string>
#include "protocol/plugin_config/aie_algorithm_type.h"
/**
* ConfigInfo
*/
const char * const CONFIG_DESCRIPTION = "Config information";
/**
* ClientInfo
*/
const int CLIENT_VERSION_VALID = 1;
const int CLIENT_VERSION_INVALID = 2;
const int CLIENT_ID_INIT = -1;
const int SESSION_ID_INIT = -1;
const char * const CLIENT_EXTEND_MSG = "Client extend message";
/**
* AlgorithmInfo
*/
// 0, sync demo plugin defined in aie_algorithm_type.h
const int ALGORITHM_TYPE_SYNC = OHOS::AI::ALGORITHM_TYPE_SAMPLE_PLUGIN_1;
// 1, async demo plugin defined in aie_algorithm_type.h
const int ALGORITHM_TYPE_ASYNC = OHOS::AI::ALGORITHM_TYPE_SAMPLE_PLUGIN_2;
const int ALGORITHM_TYPE_INVALID = 66;
const int ALGORITHM_VERSION_VALID = 1;
const char * const ALGORITHM_EXTEND_MSG = "Algorithm extend message";
/**
* DataInfo
*/
const char * const DATA_INFO_DEFAULT = "Default data info";
const char * const INPUT_INFO_PREPARE = "Prepare input data";
const char * const INPUT_INFO_SYNC_PROCESS = "Sync process input data";
const char * const INPUT_INFO_ASYNC_PROCESS = "Async process input data";
const char * const INPUT_INFO_RELEASE = "Release input data";
const char * const INPUT_INFO_SET_OPTION = "Set option input data";
const char * const INPUT_INFO_GET_OPTION = "Get option input data";
/**
* Consts for Performance Test of AieClient
*/
const int EXECUTE_TIMES = 100;
const std::string INTERFACE_GROUP_TAG = "AieClient";
const std::string AIE_CLIENT_PERF_RESULT_FILEPATH = "AieClientPerformanceTest.txt";
const std::string AIE_CLIENT_PERF_RESULT_FILEPATH_BAK = "AieClientPerformanceTestBak.txt";
const bool isSavePerfResult = true;
#endif // AIE_CLIENT_CONST_H
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#ifndef AIE_CLIENT_PERF_BASELINE_H
#define AIE_CLIENT_PERF_BASELINE_H
#include <iostream>
namespace AI_ENGINE_TEST {
/**
* Configures which type of device to be test.
*/
const int DEVICE_TYPE_L1 = 1;
const int DEVICE_TYPE_L2 = 2;
const int DEVICE_TYPE = DEVICE_TYPE_L1;
/**
* PerfBaseline to test.
*/
struct PerfBaseline {
int T01; // us, AieClientInit
int T02; // us, AieClientPrepare
int T03; // us, AieClientASyncProcess
int T04; // us, AieClientSyncProcess
int T05; // us, AieClientRelease
int T06; // us, AieClientDestroy
int T07; // us, AieClientSetOption
int T08; // us, AieClientGetOption
};
const int PERF_BASELINE_L1_AIE_CLIENT_INIT = 100000;
const int PERF_BASELINE_L1_AIE_CLIENT_PREPARE = 300000;
const int PERF_BASELINE_L1_AIE_CLIENT_ASYNC_PROCESS = 150000;
const int PERF_BASELINE_L1_AIE_CLIENT_SYNC_PROCESS = 100000;
const int PERF_BASELINE_L1_AIE_CLIENT_RELEASE = 300000;
const int PERF_BASELINE_L1_AIE_CLIENT_DESTROY = 100000;
const int PERF_BASELINE_L1_AIE_CLIENT_SET_OPTION = 100000;
const int PERF_BASELINE_L1_AIE_CLIENT_GET_OPTION = 100000;
PerfBaseline L1 = {
.T01 = PERF_BASELINE_L1_AIE_CLIENT_INIT, // us, AieClientInit
.T02 = PERF_BASELINE_L1_AIE_CLIENT_PREPARE, // us, AieClientPrepare
.T03 = PERF_BASELINE_L1_AIE_CLIENT_ASYNC_PROCESS, // us, AieClientASyncProcess
.T04 = PERF_BASELINE_L1_AIE_CLIENT_SYNC_PROCESS, // us, AieClientSyncProcess
.T05 = PERF_BASELINE_L1_AIE_CLIENT_RELEASE, // us, AieClientRelease
.T06 = PERF_BASELINE_L1_AIE_CLIENT_DESTROY, // us, AieClientDestroy
.T07 = PERF_BASELINE_L1_AIE_CLIENT_SET_OPTION, // us, AieClientSetOption
.T08 = PERF_BASELINE_L1_AIE_CLIENT_GET_OPTION, // us, AieClientGetOption
};
const int PERF_BASELINE_L2_AIE_CLIENT_INIT = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_PREPARE = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_ASYNC_PROCESS = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_SYNC_PROCESS = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_RELEASE = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_DESTROY = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_SET_OPTION = 500;
const int PERF_BASELINE_L2_AIE_CLIENT_GET_OPTION = 500;
PerfBaseline L2 = {
.T01 = PERF_BASELINE_L2_AIE_CLIENT_INIT, // us, AieClientInit
.T02 = PERF_BASELINE_L2_AIE_CLIENT_PREPARE, // us, AieClientPrepare
.T03 = PERF_BASELINE_L2_AIE_CLIENT_ASYNC_PROCESS, // us, AieClientASyncProcess
.T04 = PERF_BASELINE_L2_AIE_CLIENT_SYNC_PROCESS, // us, AieClientSyncProcess
.T05 = PERF_BASELINE_L2_AIE_CLIENT_RELEASE, // us, AieClientRelease
.T06 = PERF_BASELINE_L2_AIE_CLIENT_DESTROY, // us, AieClientDestroy
.T07 = PERF_BASELINE_L2_AIE_CLIENT_SET_OPTION, // us, AieClientSetOption
.T08 = PERF_BASELINE_L2_AIE_CLIENT_GET_OPTION, // us, AieClientGetOption
};
/**
* Gets Performance BaseLine according to deviceType.
*/
PerfBaseline GetPerformanceBaseLine(int deviceType)
{
PerfBaseline aieClientPerfBase;
switch (deviceType) {
case DEVICE_TYPE_L1: {
aieClientPerfBase = L1;
break;
}
case DEVICE_TYPE_L2: {
aieClientPerfBase = L2;
break;
}
default: {
aieClientPerfBase = L1;
break;
}
}
return aieClientPerfBase;
}
}
#endif // AIE_CLIENT_PERF_BASELINE_H
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#ifndef SERVICE_DEAD_CB_H
#define SERVICE_DEAD_CB_H
#include "client_executor/include/i_client_cb.h"
#include "utils/log/aie_log.h"
namespace OHOS::AI {
class ServiceDeadCb : public IServiceDeadCb {
public:
ServiceDeadCb() = default;
~ServiceDeadCb() override = default;
void OnServiceDead() override
{
HILOGI("[ServiceDeadCb]OnServiceDead Callback happens");
}
};
}
#endif // __SERVICE_DEAD_CB_H__
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include "securec.h"
#include "utils.h"
#include "utils/log/aie_log.h"
using namespace std;
namespace {
const int CHAR_TYPE = 4;
const char MIN_UPPER_CASE_CHAR = 'A';
const char MIN_LOWER_CASE_CHAR = 'a';
const char MIN_NUMERIC_CHAR = '0';
const char TRAILING_CHAR = '\0';
const int NUMBER_OF_ALPHABETS = 26;
const int NUMBER_OF_DIGITS = 10;
const int CHAR_TYPE_UPPER_CASE = 1;
const int CHAR_TYPE_LOWER_CASE = 2;
const int CHAR_TYPE_WHITE_SPACE = 3;
const char WHITE_SPACE = ' ';
const int DIVISOR_TWO = 2;
const int DEFAULT_RANDOM_INT = 1;
}
/**
* Return n: 0 <= n <= max
*/
int GetRandomInt(int max)
{
if (max >= 0) {
int randomInt = rand() % (max + 1);
return randomInt;
}
return DEFAULT_RANDOM_INT;
}
/**
* Return true or false by random.
*/
bool GetRandomBool()
{
return (rand() % DIVISOR_TWO == 1) ? true : false;
}
/**
* Gets current system date and time in format of YYYYMMDDhhmmss. E.g. 20201109123000.
*/
std::string GetSystemTime()
{
time_t currentSystemTime = time(nullptr);
char formatTime[32] = {};
strftime(formatTime, sizeof(formatTime), "%Y%m%d%H%M%S", localtime(&currentSystemTime));
string formatTimeString = formatTime;
return formatTimeString;
}
/**
* Generates a string with specified length by random, which ends up with
* a null character '\0'. As a result, to generate a string with 20 characters,
* the len must be 21, and the str must point to an array of which the length is 21.
*
* len Length of string.
* str The string to be generated.
*/
void GetRandomString(const int len, char *str)
{
srand(time(nullptr));
for (int i = 0; i < len - 1; ++i) {
switch (rand() % CHAR_TYPE) {
case CHAR_TYPE_UPPER_CASE:
str[i] = MIN_UPPER_CASE_CHAR + rand() % NUMBER_OF_ALPHABETS;
break;
case CHAR_TYPE_LOWER_CASE:
str[i] = MIN_LOWER_CASE_CHAR + rand() % NUMBER_OF_ALPHABETS;
break;
case CHAR_TYPE_WHITE_SPACE:
str[i] = WHITE_SPACE;
break;
default:
str[i] = MIN_NUMERIC_CHAR + rand() % NUMBER_OF_DIGITS;
break;
}
}
str[len - 1] = TRAILING_CHAR;
}
/**
* Save characters to txt Document.
*
* input a string to be saved in the file.
* path path and filename of result text
*/
void SaveCharTextAppend(char *input, char *path)
{
HILOGI("[Test][SaveCharTextAppend]input is %s\n", input);
if (path == nullptr) {
return;
}
FILE *pFile = fopen(path, "a+");
if (pFile == nullptr) {
return;
}
fwrite(input, strlen(input), 1, pFile);
fwrite("\n", 1, 1, pFile);
fclose(pFile);
}
/**
* Save strings to txt Document.
*
* input a string to be saved in the file.
* path path and filename of result text
*/
void SaveStringTextAppend(std::string input, std::string path)
{
SaveCharTextAppend((char*)input.c_str(), (char*)path.c_str());
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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.
*/
#ifndef UTILS_H
#define UTILS_H
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include "securec.h"
#include "utils/log/aie_log.h"
/**
* return random number n: 0 <= n <= max
*/
int GetRandomInt(int max);
/**
* Return true of false by random.
*/
bool GetRandomBool();
/**
* Gets current system date and time in format of YYYYMMDDhhmmss. E.g. 20201109123000.
*/
std::string GetSystemTime();
/**
* Generates a string with specified length by random.
*
* len Length of string + 1, e.g. to generate a 20-bit string, set the input parameter len to 21.
* str The string to be generated.
*/
void GetRandomString(const int len, char *str);
/**
* Save characters to txt Document.
*
* input a string to be saved in the file.
* path path and filename of result text
*/
void SaveCharTextAppend(char *input, char *path);
/**
* Save strings to txt Document.
*
* input a string to be saved in the file.
* path path and filename of result text
*/
void SaveStringTextAppend(std::string input, std::string path);
#endif
\ No newline at end of file
# Copyright (c) 2020 Huawei Device Co., Ltd.
# 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.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/build/suite_lite.gni")
import("//build/lite/config/subsystem/aafwk/config.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsAbilityMgrTest") {
suite_name = "acts"
sources = [
"src/AbilityMgrTest.cpp"
]
ldflags = [
"-lstdc++",
]
if (enable_ohos_appexecfwk_feature_ability == true) {
sources = [ "src/AbilityMgrTest.cpp" ]
} else {
sources = [ "src/AbilityMgrTest2.cpp" ]
}
deps = [
"//base/hiviewdfx/frameworks/hilog_lite/featured:hilog_shared",
"//foundation/aafwk/frameworks/ability_lite:aafwk_abilitykit_lite",
"//foundation/appexecfwk/frameworks/bundle_lite:bundle",
"//foundation/communication/frameworks/ipc_lite:liteipc_adapter",
"//foundation/distributedschedule/services/samgr_lite/samgr:samgr",
"${aafwk_lite_path}/frameworks/ability_lite:aafwk_abilitykit_lite",
"${appexecfwk_lite_path}/frameworks/bundle_lite:bundle",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//foundation/communication/ipc_lite:liteipc_adapter",
"//foundation/distributedschedule/samgr_lite/samgr:samgr",
"//utils/native/lite/kv_store:kv_store",
]
if (enable_ohos_appexecfwk_feature_ability == true) {
deps += [
"//foundation/graphic/lite/frameworks/ui:ui",
"//foundation/graphic/lite/utils:graphic_utils",
"//foundation/graphic/lite/frameworks/surface",
"//foundation/graphic/surface",
"//foundation/graphic/ui:lite_ui",
"//foundation/graphic/utils:lite_graphic_utils",
]
}
include_dirs = [
"src",
"//third_party/googletest/googletest/include",
"//foundation/aafwk/interfaces/innerkits/abilitymgr_lite",
"//foundation/aafwk/interfaces/kits/ability_lite",
"//foundation/aafwk/interfaces/kits/want_lite",
"//foundation/aafwk/services/abilitymgr_lite/include",
"//foundation/aafwk/frameworks/abilitymgr_lite/include",
"//foundation/appexecfwk/interfaces/kits/bundle_lite/",
"//foundation/appexecfwk/utils/bundle_lite",
"//foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite/",
"//foundation/distributedschedule/interfaces/kits/samgr_lite/registry",
"//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr",
"${aafwk_lite_path}/interfaces/innerkits/abilitymgr_lite",
"${aafwk_lite_path}/interfaces/kits/ability_lite",
"${aafwk_lite_path}/interfaces/kits/want_lite",
"${aafwk_lite_path}/services/abilitymgr_lite/include",
"${aafwk_lite_path}/frameworks/abilitymgr_lite/include",
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite/",
"${appexecfwk_lite_path}/utils/bundle_lite",
"${appexecfwk_lite_path}/interfaces/innerkits/bundlemgr_lite/",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/registry",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
"//kernel/liteos_a/kernel/include",
"//kernel/liteos_a/kernel/common",
"//third_party/bounds_checking_function/include",
"//third_party/cJSON",
"//utils/native/lite/include",
"//kernel/liteos_a/lib/libsec/include",
"//foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite",
"//foundation/graphic/lite/interfaces/kits/ui",
"//foundation/graphic/lite/interfaces/kits/utils",
"//foundation/graphic/lite/interfaces/kits/config",
"${appexecfwk_lite_path}/interfaces/innerkits/bundlemgr_lite",
"//foundation/graphic/ui/interfaces/kits",
"//foundation/graphic/utils/interfaces/innerkits",
"//foundation/graphic/utils/interfaces/kits",
]
cflags = [ "-Wno-error" ]
defines = ["OHOS_APPEXECFWK_BMS_BUNDLEMANAGER",
defines = [
"OHOS_APPEXECFWK_BMS_BUNDLEMANAGER",
"ABILITY_WINDOW_SUPPORT",
]
ldflags = [
"-lstdc++",
"-lm",
"-lpthread",
]
}
此差异已折叠。
# Copyright (c) 2020 Huawei Device Co., Ltd.
# 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.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/build/suite_lite.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsBundleMgrTest") {
suite_name = "acts"
sources = [
"src/BundleMgrTest.cpp"
]
sources = [ "src/BundleMgrTest.cpp" ]
include_dirs = [
"src",
"//foundation/aafwk/interfaces/innerkits/abilitymgr_lite",
"//foundation/aafwk/interfaces/kits/ability_lite",
"//foundation/aafwk/interfaces/kits/want_lite",
"//foundation/aafwk/services/abilitymgr_lite/include",
"//foundation/appexecfwk/interfaces/kits/bundle_lite/",
"//foundation/appexecfwk/utils/bundle_lite",
"//foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite/",
"//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr",
"//foundation/distributedschedule/interfaces/kits/samgr_lite/registry",
"${aafwk_lite_path}/interfaces/innerkits/abilitymgr_lite",
"${aafwk_lite_path}/interfaces/kits/ability_lite",
"${aafwk_lite_path}/interfaces/kits/want_lite",
"${aafwk_lite_path}/services/abilitymgr_lite/include",
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite/",
"${appexecfwk_lite_path}/utils/bundle_lite",
"${appexecfwk_lite_path}/interfaces/innerkits/bundlemgr_lite/",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
"//foundation/distributedschedule/samgr_lite/interfaces/kits/registry",
"//third_party/googletest/googletest/include",
"//utils/native/lite/include",
"//foundation/aafwk/interfaces/innerkits/intent_lite",
"${aafwk_lite_path}/interfaces/innerkits/intent_lite",
"//kernel/liteos_a/kernel/include",
"//kernel/liteos_a/kernel/common",
"//third_party/cJSON",
]
ldflags = [
"-lstdc++",
]
deps = [
"//base/hiviewdfx/frameworks/hilog_lite/featured:hilog_shared",
"//foundation/appexecfwk/frameworks/bundle_lite:bundle",
"//foundation/communication/frameworks/ipc_lite:liteipc_adapter",
"//foundation/distributedschedule/services/samgr_lite/samgr:samgr",
"${appexecfwk_lite_path}/frameworks/bundle_lite:bundle",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//foundation/communication/ipc_lite:liteipc_adapter",
"//foundation/distributedschedule/samgr_lite/samgr:samgr",
]
cflags = [ "-Wno-error" ]
defines = ["OHOS_APPEXECFWK_BMS_BUNDLEMANAGER"]
defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ]
ldflags = [
"-lstdc++",
"-lm",
"-lpthread",
]
}
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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.
import("//build/lite/config/subsystem/aafwk/config.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
lite_component("acts_component") {
all_features = []
features = []
if (ohos_xts_test_args != "") {
args = [
"--method_name",
"get_target_modules",
"--arguments",
"all_features=${ohos_xts_test_args}",
]
all_features +=
exec_script(rebase_path("//test/xts/tools/lite/build/utils.py"),
args,
"list lines")
} else {
if (ohos_kernel_type == "liteos_m") {
all_features += [
"//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest",
"//test/xts/acts/communication_lite/softbus_hal:ActsSoftBusTest",
"//test/xts/acts/communication_lite/wifiservice_hal:ActsWifiServiceTest",
"//test/xts/acts/utils_lite/utilsfile_hal:ActsUtilsFileTest",
"//test/xts/acts/utils_lite/parameter_hal:ActsParameterTest",
"//test/xts/acts/iot_hardware_lite/wifiiot_hal:ActsWifiIotTest",
"//test/xts/acts/kernel_lite/kernelcmsis_hal:ActsCMSISTest",
"//test/xts/acts/utils_lite/kvstore_hal:ActsKvStoreTest",
"//test/xts/acts/security_lite/datahuks_hal:ActsSecurityDataTest",
"//test/xts/acts/distributed_schedule_lite/samgr_hal:ActsSamgrTest",
"//test/xts/acts/update_lite/updater_hal:ActsUpdaterFuncTest",
]
} else if (ohos_kernel_type == "liteos_a") {
all_features += [
"//test/xts/acts/kernel_lite:ActsKernelTest",
"//test/xts/acts/security_lite:securitytest",
"//test/xts/acts/utils_lite/kvstore_posix:ActsKvStoreTest",
"//test/xts/acts/startup_lite/parameter_posix:ActsParameterTest",
"//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/camera:ActsMediaCameraTest",
"//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/player:ActsMediaPlayerTest",
"//test/xts/acts/distributed_schedule_lite/samgr_posix:ActsSamgrTest",
#"//test/xts/acts/distributedschedule_lite/dtbschedmgr_posix:ActsDMSTest",
"//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/recorder:ActsMediaRecorderTest",
"//test/xts/acts/graphic_lite:uikit_test",
"//test/xts/acts/appexecfwk_lite/bundlems_posix:ActsBundleMgrTest",
"//test/xts/acts/appexecfwk_lite/abilityms_posix:ActsAbilityMgrTest",
"//test/xts/acts/communication_lite/softbus_posix:ActsSoftBusTest",
"//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
"//test/xts/acts/ai_lite:ActsAiTest",
"//test/xts/acts/global_lite:ActsGlobalTest",
"//test/xts/acts/sensors_lite:sensorstest",
]
} else if (ohos_kernel_type == "linux") {
all_features += [
"//test/xts/acts/utils_lite/kvstore_posix:ActsKvStoreTest",
"//test/xts/acts/startup_lite/parameter_posix:ActsParameterTest",
"//test/xts/acts/security_lite/datahuks_posix:ActsSecurityDataTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/camera:ActsMediaCameraTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/recorder:ActsMediaRecorderTest",
"//test/xts/acts/multimedia_lite/multimedia_posix/player:ActsMediaPlayerTest",
"//test/xts/acts/distributed_schedule_lite/samgr_posix:ActsSamgrTest",
"//test/xts/acts/appexecfwk_lite/bundlems_posix:ActsBundleMgrTest",
"//test/xts/acts/appexecfwk_lite/abilityms_posix:ActsAbilityMgrTest",
]
}
}
if (ohos_build_type == "debug") {
_all_features = ""
_product_json = rebase_path("${product_path}/config.json")
foreach(one_feature, all_features) {
_all_features = _all_features + one_feature + ","
}
_args = [
"--method_name",
"filter_by_subsystem",
"--arguments",
"testsuites=${_all_features}#product_json=${_product_json}",
]
features += exec_script(rebase_path("//test/xts/tools/lite/build/utils.py"),
_args,
"list lines")
}
}
test_suite("acts") {
deps = [ ":acts_component" ]
version = "OpenHarmony-ACTS-1.11.0"
if (ohos_kernel_type == "liteos_a") {
deps += [ "//test/xts/tools/lite/others/query:query" ]
copy("query_copy") {
sources = [ "$root_out_dir/bin/query.bin" ]
outputs = [ "$root_out_dir/suites/acts/resource/tools/query.bin" ]
}
}
}
generate_notice_file("acts_notice_file") {
module_name = "acts"
module_source_dir_list = [
"//third_party/googletest",
"//third_party/unity",
"//third_party/bounds_checking_function",
"//third_party/iniparser",
]
}
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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
......@@ -11,15 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite_lite.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hctest_suite("ActsLwipTest") {
suite_name = "acts"
sources = [ "src/lwip_func_test.c" ]
include_dirs = [
"//kernel/liteos_m/kal",
]
include_dirs = [ "//kernel/liteos_m/kal" ]
cflags = [ "-Wno-error" ]
}
# Copyright (c) 2020 Huawei Device Co., Ltd.
# 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.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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.
import("//test/xts/tools/build/suite_lite.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsLwipTest") {
suite_name = "acts"
sources = [
"src/ActsLwipTest.cpp",
]
sources = [ "src/ActsLwipTest.cpp" ]
defines = [
"_GNU_SOURCE",
"restrict=",
]
deps = [
"//test/xts/tools/hcpptest:hcpptest",
"//base/security/frameworks/huks_lite/source:huks",
]
deps = [ "//base/security/huks/frameworks/huks_lite/source:huks" ]
cflags = ["-Wno-error"]
cflags = [ "-Wno-error" ]
}
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册