TDD用例规范整改

Signed-off-by: li-tiangang4 <litiangang4@huawei.com>
This commit is contained in:
li-tiangang4
2025-03-14 12:28:27 +08:00
parent 63bf3a1e86
commit 493d5b78bd
35 changed files with 205 additions and 203 deletions
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/white_list_test"
module_out_path = unittest_output_path
group("whitelistunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2024 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
@@ -41,7 +41,7 @@ void WhiteListTest::TearDownTestCase()
{
}
HWTEST_F(WhiteListTest, SyncWhiteList01, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, SyncWhiteList01, testing::ext::TestSize.Level1)
{
// 11|22,33|44,55,66
// 1,2|3,4,5
@@ -69,7 +69,7 @@ HWTEST_F(WhiteListTest, SyncWhiteList01, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, SyncWhiteList02, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, SyncWhiteList02, testing::ext::TestSize.Level1)
{
// 11|22,33|44,55,66
// 1,2|3,4,5
@@ -97,7 +97,7 @@ HWTEST_F(WhiteListTest, SyncWhiteList02, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, SyncWhiteList03, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, SyncWhiteList03, testing::ext::TestSize.Level1)
{
// 1,2,1,2
std::string deviceId = "test1";
@@ -123,7 +123,7 @@ HWTEST_F(WhiteListTest, SyncWhiteList03, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, SyncWhiteList04, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, SyncWhiteList04, testing::ext::TestSize.Level1)
{
// 2,8|3,4,5
std::string deviceId = "test1";
@@ -149,7 +149,7 @@ HWTEST_F(WhiteListTest, SyncWhiteList04, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, GetWhiteList01, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, GetWhiteList01, testing::ext::TestSize.Level1)
{
std::string deviceId = "test";
TYPE_WHITE_LIST_VEC vecWhiteList;
@@ -157,7 +157,7 @@ HWTEST_F(WhiteListTest, GetWhiteList01, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, GetWhiteList02, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, GetWhiteList02, testing::ext::TestSize.Level1)
{
std::string deviceId = "test1";
TYPE_WHITE_LIST_VEC vecWhiteList;
@@ -165,7 +165,7 @@ HWTEST_F(WhiteListTest, GetWhiteList02, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, GetWhiteList03, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, GetWhiteList03, testing::ext::TestSize.Level1)
{
std::string deviceId = "xxx";
TYPE_WHITE_LIST_VEC vecWhiteList;
@@ -173,7 +173,7 @@ HWTEST_F(WhiteListTest, GetWhiteList03, testing::ext::TestSize.Level0)
EXPECT_EQ(ERR_DH_INPUT_WHILTELIST_GET_WHILTELIST_FAIL, ret);
}
HWTEST_F(WhiteListTest, GetWhiteList04, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, GetWhiteList04, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
TYPE_WHITE_LIST_VEC vecWhiteList;
@@ -181,7 +181,7 @@ HWTEST_F(WhiteListTest, GetWhiteList04, testing::ext::TestSize.Level0)
EXPECT_EQ(ERR_DH_INPUT_WHILTELIST_GET_WHILTELIST_FAIL, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut01, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut01, testing::ext::TestSize.Level1)
{
// 11,33,55,66
std::string deviceId = "test";
@@ -194,7 +194,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut01, testing::ext::TestSize.Level0)
EXPECT_EQ(true, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut02, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut02, testing::ext::TestSize.Level1)
{
// 11,44,55,66
std::string deviceId = "test";
@@ -207,7 +207,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut02, testing::ext::TestSize.Level0)
EXPECT_EQ(true, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut03, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut03, testing::ext::TestSize.Level1)
{
// 22,33,55,66
std::string deviceId = "test";
@@ -220,7 +220,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut03, testing::ext::TestSize.Level0)
EXPECT_EQ(true, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut04, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut04, testing::ext::TestSize.Level1)
{
// 22,44,55,66
std::string deviceId = "test";
@@ -233,7 +233,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut04, testing::ext::TestSize.Level0)
EXPECT_EQ(true, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut05, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut05, testing::ext::TestSize.Level1)
{
// 1,2,4,5
std::string deviceId = "test";
@@ -246,7 +246,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut05, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut06, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut06, testing::ext::TestSize.Level1)
{
// 1,3,4,5
std::string deviceId = "test";
@@ -259,7 +259,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut06, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut07, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut07, testing::ext::TestSize.Level1)
{
// 2,2,4,5
std::string deviceId = "test";
@@ -272,7 +272,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut07, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut08, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut08, testing::ext::TestSize.Level1)
{
// 1,1,4,5
std::string deviceId = "test";
@@ -285,7 +285,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut08, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut09, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut09, testing::ext::TestSize.Level1)
{
// 1,2,1,5
std::string deviceId = "test";
@@ -298,7 +298,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut09, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut10, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut10, testing::ext::TestSize.Level1)
{
// 1,2,4,1
std::string deviceId = "test";
@@ -311,7 +311,7 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut10, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, IsNeedFilterOut11, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, IsNeedFilterOut11, testing::ext::TestSize.Level1)
{
// 1,2,4,5,6
std::string deviceId = "test";
@@ -325,21 +325,21 @@ HWTEST_F(WhiteListTest, IsNeedFilterOut11, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret);
}
HWTEST_F(WhiteListTest, ClearWhiteList01, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, ClearWhiteList01, testing::ext::TestSize.Level1)
{
std::string deviceId = "test";
int32_t ret = WhiteListUtil::GetInstance().ClearWhiteList(deviceId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, ClearWhiteList02, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, ClearWhiteList02, testing::ext::TestSize.Level1)
{
std::string deviceId = "test1";
int32_t ret = WhiteListUtil::GetInstance().ClearWhiteList(deviceId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(WhiteListTest, ClearWhiteList03, testing::ext::TestSize.Level0)
HWTEST_F(WhiteListTest, ClearWhiteList03, testing::ext::TestSize.Level1)
{
std::string deviceId;
int32_t ret = WhiteListUtil::GetInstance().ClearWhiteList(deviceId);
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/dfx_utils"
module_out_path = unittest_output_path
group("dfxtest") {
testonly = true
+3 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -44,4 +44,6 @@ fwk_interfaces_path = "${distributedhardwarefwk_path}/interfaces/inner_kits"
av_transport_path = "${distributedhardwarefwk_path}/av_transport"
unittest_output_path = "distributed_input/distributed_input"
distributedinput_ldflags = [ "-lpthread" ]
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/input_handler"
module_out_path = unittest_output_path
group("inputhandlertest") {
testonly = true
+1 -1
View File
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/inner_kits"
module_out_path = unittest_output_path
group("unittest") {
testonly = true
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("addwhitelistinfoscallbackunittest") {
testonly = true
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("clientunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
* Copyright (c) 2022-2025 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
@@ -209,7 +209,7 @@ HWTEST_F(DistributedInputClientTest, PrepareRemoteInput02, testing::ext::TestSiz
EXPECT_EQ(ERR_DH_INPUT_CLIENT_PREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, PrepareRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, PrepareRemoteInput03, testing::ext::TestSize.Level1)
{
std::string srcId = "PrepareRemoteInput_test";
std::string sinkId = "PrepareRemoteInput_test";
@@ -218,7 +218,7 @@ HWTEST_F(DistributedInputClientTest, PrepareRemoteInput03, testing::ext::TestSiz
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_PREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, PrepareRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, PrepareRemoteInput04, testing::ext::TestSize.Level1)
{
std::string srcId = "";
std::string sinkId = "";
@@ -227,7 +227,7 @@ HWTEST_F(DistributedInputClientTest, PrepareRemoteInput04, testing::ext::TestSiz
EXPECT_EQ(ERR_DH_INPUT_CLIENT_PREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "UnprepareRemoteInput01";
sptr<TestUnprepareDInputCallback> callback(new TestUnprepareDInputCallback());
@@ -235,7 +235,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput01, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput02, testing::ext::TestSize.Level1)
{
string deviceId = "";
sptr<TestUnprepareDInputCallback> callback = nullptr;
@@ -243,7 +243,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput02, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_CLIENT_UNPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput03, testing::ext::TestSize.Level1)
{
std::string srcId = "PrepareRemoteInput_src";
std::string sinkId = "PrepareRemoteInput_sink";
@@ -252,7 +252,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput03, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_UNPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput04, testing::ext::TestSize.Level1)
{
std::string srcId = "";
std::string sinkId = "";
@@ -261,7 +261,7 @@ HWTEST_F(DistributedInputClientTest, UnprepareRemoteInput04, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_CLIENT_UNPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "StartRemoteInput01";
sptr<TestStartDInputCallback> callback(new TestStartDInputCallback());
@@ -270,7 +270,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput01, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput02, testing::ext::TestSize.Level1)
{
string deviceId = "";
sptr<TestStartDInputCallback> callback = nullptr;
@@ -279,7 +279,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput02, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_CLIENT_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput03, testing::ext::TestSize.Level1)
{
std::string sinkId = "StartRemoteInput_sink";
std::vector<std::string> dhIds = {"dhIds_test"};
@@ -288,7 +288,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput03, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput04, testing::ext::TestSize.Level1)
{
std::string sinkId = "";
std::vector<std::string> dhIds;
@@ -297,7 +297,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput04, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_CLIENT_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput05, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput05, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -307,7 +307,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput05, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput06, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput06, testing::ext::TestSize.Level1)
{
string srcId = "";
string sinkId = "";
@@ -317,7 +317,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput06, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_CLIENT_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput07, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput07, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -327,7 +327,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput07, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StartRemoteInput08, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StartRemoteInput08, testing::ext::TestSize.Level1)
{
string srcId = "";
string sinkId = "";
@@ -337,7 +337,7 @@ HWTEST_F(DistributedInputClientTest, StartRemoteInput08, testing::ext::TestSize.
EXPECT_EQ(ERR_DH_INPUT_CLIENT_START_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "StopRemoteInput01";
sptr<TestStopDInputCallback> callback(new TestStopDInputCallback());
@@ -346,7 +346,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput01, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput02, testing::ext::TestSize.Level1)
{
string deviceId = "";
sptr<TestStopDInputCallback> callback = nullptr;
@@ -355,7 +355,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput02, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_CLIENT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput03, testing::ext::TestSize.Level1)
{
std::string sinkId = "StartRemoteInput_test";
std::vector<std::string> dhIds = {"dhIds_test"};
@@ -364,7 +364,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput03, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput04, testing::ext::TestSize.Level1)
{
std::string sinkId = "";
std::vector<std::string> dhIds;
@@ -373,7 +373,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput04, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_CLIENT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput05, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput05, testing::ext::TestSize.Level1)
{
string srcId = "StopRemoteInput03-src";
string sinkId = "StopRemoteInput03-sink";
@@ -383,7 +383,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput05, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput06, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput06, testing::ext::TestSize.Level1)
{
string srcId = "";
string sinkId = "";
@@ -393,7 +393,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput06, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_CLIENT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput07, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput07, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -403,7 +403,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput07, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, StopRemoteInput08, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, StopRemoteInput08, testing::ext::TestSize.Level1)
{
string srcId = "";
string sinkId = "";
@@ -428,7 +428,7 @@ HWTEST_F(DistributedInputClientTest, StopRemoteInput08, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_CLIENT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputClientTest, ProcessEvent01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, ProcessEvent01, testing::ext::TestSize.Level1)
{
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
DistributedInputClient::DInputClientEventHandler eventHandler(runner);
@@ -439,7 +439,7 @@ HWTEST_F(DistributedInputClientTest, ProcessEvent01, testing::ext::TestSize.Leve
EXPECT_EQ(event->GetInnerEventId(), DINPUT_CLIENT_CHECK_SOURCE_CALLBACK_REGISTER_MSG);
}
HWTEST_F(DistributedInputClientTest, ProcessEvent02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, ProcessEvent02, testing::ext::TestSize.Level1)
{
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
DistributedInputClient::DInputClientEventHandler eventHandler(runner);
@@ -450,7 +450,7 @@ HWTEST_F(DistributedInputClientTest, ProcessEvent02, testing::ext::TestSize.Leve
EXPECT_EQ(event->GetInnerEventId(), DINPUT_CLIENT_CHECK_SINK_CALLBACK_REGISTER_MSG);
}
HWTEST_F(DistributedInputClientTest, ProcessEvent03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, ProcessEvent03, testing::ext::TestSize.Level1)
{
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
DistributedInputClient::DInputClientEventHandler eventHandler(runner);
@@ -461,7 +461,7 @@ HWTEST_F(DistributedInputClientTest, ProcessEvent03, testing::ext::TestSize.Leve
EXPECT_EQ(event->GetInnerEventId(), DINPUT_CLIENT_CLEAR_SOURCE_CALLBACK_REGISTER_MSG);
}
HWTEST_F(DistributedInputClientTest, ProcessEvent04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputClientTest, ProcessEvent04, testing::ext::TestSize.Level1)
{
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
DistributedInputClient::DInputClientEventHandler eventHandler(runner);
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("delwhitelistinfoscallbackunittest") {
testonly = true
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("dinputsourcecallbackunittest") {
testonly = true
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("ipcunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
* Copyright (c) 2022-2025 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
@@ -345,7 +345,7 @@ HWTEST_F(DistributedInputIpcTest, PrepareRemoteInput01, testing::ext::TestSize.L
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, UnprepareRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, UnprepareRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "UnprepareRemoteInput01";
sptr<IUnprepareDInputCallback> callback = nullptr;
@@ -353,7 +353,7 @@ HWTEST_F(DistributedInputIpcTest, UnprepareRemoteInput01, testing::ext::TestSize
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StartRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StartRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "StartRemoteInput01";
sptr<IStartDInputCallback> callback = nullptr;
@@ -362,7 +362,7 @@ HWTEST_F(DistributedInputIpcTest, StartRemoteInput01, testing::ext::TestSize.Lev
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StartRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StartRemoteInput02, testing::ext::TestSize.Level1)
{
std::string sinkId = "StartRemoteInput_sink";
std::vector<std::string> dhIds = {"dhIds_test"};
@@ -371,7 +371,7 @@ HWTEST_F(DistributedInputIpcTest, StartRemoteInput02, testing::ext::TestSize.Lev
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StartRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StartRemoteInput03, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -381,7 +381,7 @@ HWTEST_F(DistributedInputIpcTest, StartRemoteInput03, testing::ext::TestSize.Lev
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StartRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StartRemoteInput04, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -391,7 +391,7 @@ HWTEST_F(DistributedInputIpcTest, StartRemoteInput04, testing::ext::TestSize.Lev
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StopRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StopRemoteInput01, testing::ext::TestSize.Level1)
{
string deviceId = "StopRemoteInput01";
sptr<IStopDInputCallback> callback = nullptr;
@@ -400,7 +400,7 @@ HWTEST_F(DistributedInputIpcTest, StopRemoteInput01, testing::ext::TestSize.Leve
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StopRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StopRemoteInput02, testing::ext::TestSize.Level1)
{
std::string sinkId = "StartRemoteInput_test";
std::vector<std::string> dhIds = {"dhIds_test"};
@@ -409,7 +409,7 @@ HWTEST_F(DistributedInputIpcTest, StopRemoteInput02, testing::ext::TestSize.Leve
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StopRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StopRemoteInput03, testing::ext::TestSize.Level1)
{
string srcId = "StopRemoteInput03-src";
string sinkId = "StopRemoteInput03-sink";
@@ -419,7 +419,7 @@ HWTEST_F(DistributedInputIpcTest, StopRemoteInput03, testing::ext::TestSize.Leve
EXPECT_EQ(ERR_DH_INPUT_CLIENT_GET_SOURCE_PROXY_FAIL, ret);
}
HWTEST_F(DistributedInputIpcTest, StopRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputIpcTest, StopRemoteInput04, testing::ext::TestSize.Level1)
{
string srcId = "StartRemoteInput01-src";
string sinkId = "StartRemoteInput01-sink";
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("unpreparedinputcallbackunittest") {
testonly = true
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/ipc"
module_out_path = unittest_output_path
group("unregisterdinputcallbackunittest") {
testonly = true
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/sink_collector"
module_out_path = unittest_output_path
group("sinkcollectorunittest") {
testonly = true
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/sink_manager"
module_out_path = unittest_output_path
group("sinkmanagerunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -89,21 +89,21 @@ int32_t DistributedInputSinkManagerTest::TestSharingDhIdListenerStub::OnNoSharin
return DH_SUCCESS;
}
HWTEST_F(DistributedInputSinkManagerTest, InitAuto, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, InitAuto, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
bool ret = sinkManager_->InitAuto();
EXPECT_EQ(true, ret);
}
HWTEST_F(DistributedInputSinkManagerTest, Init, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, Init, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
int32_t ret = sinkManager_->Init();
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkManagerTest, Release, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, Release, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
MockProcess::MockDinputProcess("dinput");
@@ -111,7 +111,7 @@ HWTEST_F(DistributedInputSinkManagerTest, Release, testing::ext::TestSize.Level0
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkManagerTest, GetStartTransFlag, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, GetStartTransFlag, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
DInputServerType flag = DInputServerType::SINK_SERVER_TYPE;
@@ -120,7 +120,7 @@ HWTEST_F(DistributedInputSinkManagerTest, GetStartTransFlag, testing::ext::TestS
EXPECT_EQ(flag, retFlag);
}
HWTEST_F(DistributedInputSinkManagerTest, GetInputTypes, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, GetInputTypes, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
uint32_t inputTypes = static_cast<uint32_t>(DInputDeviceType::MOUSE);
@@ -129,7 +129,7 @@ HWTEST_F(DistributedInputSinkManagerTest, GetInputTypes, testing::ext::TestSize.
EXPECT_EQ(inputTypes, retType);
}
HWTEST_F(DistributedInputSinkManagerTest, DeleteStopDhids01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, DeleteStopDhids01, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
int32_t sessionId = 1;
@@ -145,7 +145,7 @@ HWTEST_F(DistributedInputSinkManagerTest, DeleteStopDhids01, testing::ext::TestS
EXPECT_EQ(0, sinkManager_->sharingDhIdsMap_.size());
}
HWTEST_F(DistributedInputSinkManagerTest, GetSinkScreenInfosCbackSize01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkManagerTest, GetSinkScreenInfosCbackSize01, testing::ext::TestSize.Level1)
{
ASSERT_NE(nullptr, sinkManager_);
uint32_t ret = sinkManager_->GetSinkScreenInfosCbackSize();
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/sink_trans"
module_out_path = unittest_output_path
group("sinktransunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -56,7 +56,7 @@ void DistributedInputSinkTransTest::TearDownTestCase()
{
}
HWTEST_F(DistributedInputSinkTransTest, Init, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkTransTest, Init, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSinkTransport::GetInstance().Init();
EXPECT_EQ(DH_SUCCESS, ret);
@@ -113,7 +113,7 @@ HWTEST_F(DistributedInputSinkTransTest, RespPrepareRemoteInput04, testing::ext::
EXPECT_EQ(ERR_DH_INPUT_SERVER_SINK_TRANSPORT_RESPPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputSinkTransTest, RespUnprepareRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkTransTest, RespUnprepareRemoteInput01, testing::ext::TestSize.Level1)
{
DistributedInputSinkManager sinkMgr(4810, false);
std::shared_ptr<DistributedInputSinkManager::DInputSinkListener> statuslistener =
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/source_inject"
module_out_path = unittest_output_path
group("sourceinjectunittest") {
testonly = true
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -14,7 +14,7 @@
import("//build/test.gni")
import("../../../../../distributedinput.gni")
module_out_path = "distributed_input/source_manager"
module_out_path = unittest_output_path
group("sourcemanagerunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -230,7 +230,7 @@ HWTEST_F(DistributedInputSourceManagerTest, OnStart_01, testing::ext::TestSize.L
EXPECT_EQ(0, sourceManager_->inputDevice_.size());
}
HWTEST_F(DistributedInputSourceManagerTest, Init01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceManagerTest, Init01, testing::ext::TestSize.Level1)
{
int32_t ret = sourceManager_->Init();
EXPECT_EQ(DH_SUCCESS, ret);
@@ -1030,28 +1030,28 @@ HWTEST_F(DistributedInputSourceManagerTest, IsStringDataSame_02, testing::ext::T
EXPECT_EQ(true, ret);
}
HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback01, testing::ext::TestSize.Level1)
{
sptr<TestAddWhiteListInfosCb> callback = nullptr;
int32_t ret = sourceManager_->RegisterAddWhiteListCallback(callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_REG_CALLBACK_ERR, ret);
}
HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceManagerTest, RegisterAddWhiteListCallback02, testing::ext::TestSize.Level1)
{
sptr<TestAddWhiteListInfosCb> callback(new TestAddWhiteListInfosCb());
int32_t ret = sourceManager_->RegisterAddWhiteListCallback(callback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback01, testing::ext::TestSize.Level1)
{
sptr<TestDelWhiteListInfosCb> callback = nullptr;
int32_t ret = sourceManager_->RegisterDelWhiteListCallback(callback);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_MANAGER_REG_CALLBACK_ERR, ret);
}
HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceManagerTest, RegisterDelWhiteListCallback02, testing::ext::TestSize.Level1)
{
sptr<TestDelWhiteListInfosCb> callback(new TestDelWhiteListInfosCb());
int32_t ret = sourceManager_->RegisterDelWhiteListCallback(callback);
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/source_trans"
module_out_path = unittest_output_path
group("sourcetransunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -44,13 +44,13 @@ void DistributedInputSourceTransTest::TearDownTestCase()
{
}
HWTEST_F(DistributedInputSourceTransTest, Init01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, Init01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSourceTransport::GetInstance().Init();
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus01, testing::ext::TestSize.Level1)
{
std::string remoteDevId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t ret = DistributedInputSourceTransport::GetInstance().OpenInputSoftbus(remoteDevId, false);
@@ -58,14 +58,14 @@ HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus01, testing::ext::Test
DistributedInputSourceTransport::GetInstance().Release();
}
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus02, testing::ext::TestSize.Level1)
{
std::string remoteDevId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t ret = DistributedInputSourceTransport::GetInstance().OpenInputSoftbus(remoteDevId, true);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus03, testing::ext::TestSize.Level1)
{
std::string remoteDevId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
DistributedInputSourceTransport::GetInstance().latencyThreadNum = 1;
@@ -74,7 +74,7 @@ HWTEST_F(DistributedInputSourceTransTest, OpenInputSoftbus03, testing::ext::Test
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, PrepareRemoteInput_01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, PrepareRemoteInput_01, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
int32_t ret = DistributedInputSourceTransport::GetInstance().PrepareRemoteInput(deviceId);
@@ -106,14 +106,14 @@ HWTEST_F(DistributedInputSourceTransTest, PrepareRemoteInput_04, testing::ext::T
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, UnprepareRemoteInput_01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, UnprepareRemoteInput_01, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
int32_t ret = DistributedInputSourceTransport::GetInstance().UnprepareRemoteInput(deviceId);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_UNPREPARE_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, UnprepareRemoteInput_02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, UnprepareRemoteInput_02, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t ret = DistributedInputSourceTransport::GetInstance().UnprepareRemoteInput(deviceId);
@@ -136,7 +136,7 @@ HWTEST_F(DistributedInputSourceTransTest, UnprepareRemoteInput_04, testing::ext:
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput01, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
int32_t ret = DistributedInputSourceTransport::GetInstance().StartRemoteInput(
@@ -144,7 +144,7 @@ HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput01, testing::ext::Test
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_START_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput02, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t ret = DistributedInputSourceTransport::GetInstance().StartRemoteInput(
@@ -152,7 +152,7 @@ HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput02, testing::ext::Test
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput03, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
std::string dhid = "Input_1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
@@ -162,7 +162,7 @@ HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput03, testing::ext::Test
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_START_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StartRemoteInput04, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::string dhid = "Input_1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
@@ -208,7 +208,7 @@ HWTEST_F(DistributedInputSourceTransTest, StartRemoteInputType_02, testing::ext:
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_START_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput01, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
int32_t ret = DistributedInputSourceTransport::GetInstance().StopRemoteInput(
@@ -216,7 +216,7 @@ HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput01, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput02, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t ret = DistributedInputSourceTransport::GetInstance().StopRemoteInput(
@@ -224,7 +224,7 @@ HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput02, testing::ext::TestS
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput03, testing::ext::TestSize.Level1)
{
std::string deviceId = "";
std::vector<std::string> dhids;
@@ -233,7 +233,7 @@ HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput03, testing::ext::TestS
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, StopRemoteInput04, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::vector<std::string> dhids;
@@ -278,7 +278,7 @@ HWTEST_F(DistributedInputSourceTransTest, StopRemoteInputType_02, testing::ext::
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginPrepareResult01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginPrepareResult01, testing::ext::TestSize.Level1)
{
std::string srcId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::string sinkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
@@ -288,7 +288,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyOriginPrepareResult01, testing::
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginUnprepareResult01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginUnprepareResult01, testing::ext::TestSize.Level1)
{
std::string srcId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::string sinkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
@@ -298,7 +298,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyOriginUnprepareResult01, testing
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginStartDhidResult01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginStartDhidResult01, testing::ext::TestSize.Level1)
{
std::string srcId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::string sinkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
@@ -309,7 +309,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyOriginStartDhidResult01, testing
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginStopDhidResult01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyOriginStopDhidResult01, testing::ext::TestSize.Level1)
{
std::string srcId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
std::string sinkId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
@@ -411,14 +411,14 @@ HWTEST_F(DistributedInputSourceTransTest, SendRelayStopTypeRequest_01, testing::
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceTransTest, LatencyCount01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, LatencyCount01, testing::ext::TestSize.Level1)
{
std::string deviceId = "deviceId";
int32_t ret = DistributedInputSourceTransport::GetInstance().LatencyCount(deviceId);
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_LATENCY_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, LatencyCount02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, LatencyCount02, testing::ext::TestSize.Level1)
{
std::string deviceId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
int32_t sessionId = 2;
@@ -483,7 +483,7 @@ HWTEST_F(DistributedInputSourceTransTest, SendRelayStopTypeRequest_02, testing::
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_STOP_FAIL, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -495,7 +495,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput01, te
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput02, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -507,7 +507,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput02, te
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput03, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -526,7 +526,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput03, te
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput04, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput04, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -538,7 +538,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponsePrepareRemoteInput04, te
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseUnprepareRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseUnprepareRemoteInput01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -552,7 +552,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponseUnprepareRemoteInput01,
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInput01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -574,7 +574,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInput01, test
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInput01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInput01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -596,7 +596,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInput01, testi
DistributedInputTransportBase::GetInstance().remoteDevSessionMap_.clear();
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInputDhid01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInputDhid01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -614,7 +614,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStartRemoteInputDhid01,
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInputDhid01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInputDhid01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -632,7 +632,7 @@ HWTEST_F(DistributedInputSourceTransTest, NotifyResponseStopRemoteInputDhid01, t
EXPECT_EQ(ERR_DH_INPUT_SERVER_SOURCE_TRANSPORT_SENDMESSSAGE, ret);
}
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseKeyState01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceTransTest, NotifyResponseKeyState01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
nlohmann::json recMsg;
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Huawei Device Co., Ltd.
# Copyright (c) 2024-2025 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
@@ -14,7 +14,7 @@
import("//build/test.gni")
import("../../../../distributedinput.gni")
module_out_path = "distributed_input/state"
module_out_path = unittest_output_path
group("dinpusinkstatetest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Copyright (c) 2024-2025 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
@@ -75,7 +75,7 @@ void DinputSinkStateTest::TearDown()
{
}
HWTEST_F(DinputSinkStateTest, RecordDhIds_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, RecordDhIds_001, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
dhIds.push_back(DHID_1);
@@ -85,7 +85,7 @@ HWTEST_F(DinputSinkStateTest, RecordDhIds_001, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DinputSinkStateTest, RecordDhIds_002, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, RecordDhIds_002, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
dhIds.push_back(DHID_1);
@@ -96,7 +96,7 @@ HWTEST_F(DinputSinkStateTest, RecordDhIds_002, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DinputSinkStateTest, RemoveDhIds_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, RemoveDhIds_001, testing::ext::TestSize.Level1)
{
std::vector<std::string> dhIds;
dhIds.push_back(DHID_1);
@@ -104,21 +104,21 @@ HWTEST_F(DinputSinkStateTest, RemoveDhIds_001, testing::ext::TestSize.Level0)
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DinputSinkStateTest, GetStateByDhid_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, GetStateByDhid_001, testing::ext::TestSize.Level1)
{
DInputSinkState::GetInstance().dhIdStateMap_[DHID_1] = DhIdState::THROUGH_OUT;
DhIdState ret = DInputSinkState::GetInstance().GetStateByDhid(DHID_1);
EXPECT_EQ(DhIdState::THROUGH_OUT, ret);
}
HWTEST_F(DinputSinkStateTest, GetStateByDhid_002, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, GetStateByDhid_002, testing::ext::TestSize.Level1)
{
std::string dhId = "dhId_test";
DhIdState ret = DInputSinkState::GetInstance().GetStateByDhid(dhId);
EXPECT_EQ(DhIdState::THROUGH_IN, ret);
}
HWTEST_F(DinputSinkStateTest, SimulateEventInjectToSrc_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, SimulateEventInjectToSrc_001, testing::ext::TestSize.Level1)
{
int32_t sessionId = 1;
std::string dhId = "dhId_test";
@@ -134,7 +134,7 @@ HWTEST_F(DinputSinkStateTest, SimulateEventInjectToSrc_001, testing::ext::TestSi
EXPECT_EQ(DInputSinkState::GetInstance().keyDownStateMap_.size(), 0);
}
HWTEST_F(DinputSinkStateTest, RemoveKeyDownState_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, RemoveKeyDownState_001, testing::ext::TestSize.Level1)
{
DInputSinkState::GetInstance().keyDownStateMap_.clear();
std::string dhId = "dhId_test";
@@ -149,14 +149,14 @@ HWTEST_F(DinputSinkStateTest, RemoveKeyDownState_001, testing::ext::TestSize.Lev
EXPECT_EQ(DInputSinkState::GetInstance().keyDownStateMap_.size(), 0);
}
HWTEST_F(DinputSinkStateTest, IsPositionEvent_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, IsPositionEvent_001, testing::ext::TestSize.Level1)
{
DInputSinkState::GetInstance().Init();
auto ret = DInputSinkState::GetInstance().GetTouchPadEventFragMgr()->IsPositionEvent(EVENT_2);
EXPECT_EQ(false, ret);
}
HWTEST_F(DinputSinkStateTest, PushEvent_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, PushEvent_001, testing::ext::TestSize.Level1)
{
auto ret = DInputSinkState::GetInstance().GetTouchPadEventFragMgr()->PushEvent(DHID_1, EVENT_1);
EXPECT_EQ(false, ret.first);
@@ -165,7 +165,7 @@ HWTEST_F(DinputSinkStateTest, PushEvent_001, testing::ext::TestSize.Level0)
EXPECT_EQ(false, ret.first);
}
HWTEST_F(DinputSinkStateTest, GetAndClearEvents_001, testing::ext::TestSize.Level0)
HWTEST_F(DinputSinkStateTest, GetAndClearEvents_001, testing::ext::TestSize.Level1)
{
std::string dhId = "dhId_test";
auto ret = DInputSinkState::GetInstance().GetTouchPadEventFragMgr()->GetAndClearEvents(dhId);
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/trans_base"
module_out_path = unittest_output_path
group("transbaseunittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
* Copyright (c) 2022-2025 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
@@ -54,13 +54,13 @@ void DistributedInputTransbaseTest::TestRegisterSessionStateCallbackStub::OnResu
(void)status;
}
HWTEST_F(DistributedInputTransbaseTest, Init01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputTransbaseTest, Init01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputTransportBase::GetInstance().Init();
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputTransbaseTest, StartSession01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputTransbaseTest, StartSession01, testing::ext::TestSize.Level1)
{
std::string remoteDevId = "";
int32_t ret = DistributedInputTransportBase::GetInstance().StartSession(remoteDevId);
@@ -76,7 +76,7 @@ HWTEST_F(DistributedInputTransbaseTest, StartSession02, testing::ext::TestSize.L
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputTransbaseTest, GetDevIdBySessionId01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputTransbaseTest, GetDevIdBySessionId01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
std::string srcId = "f6d4c08647073e02e7a78f09473aa122ff57fc81c00981fcf5be989e7d112591";
@@ -89,7 +89,7 @@ HWTEST_F(DistributedInputTransbaseTest, GetDevIdBySessionId01, testing::ext::Tes
EXPECT_EQ("", ret);
}
HWTEST_F(DistributedInputTransbaseTest, OnSessionOpened01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputTransbaseTest, OnSessionOpened01, testing::ext::TestSize.Level1)
{
int32_t sessionId = 0;
PeerSocketInfo peerSocketInfo = {
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
# Copyright (c) 2021-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/sink_handler"
module_out_path = unittest_output_path
group("unittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -39,38 +39,38 @@ void DistributedInputSinkHandlerTest::TearDownTestCase()
{
}
HWTEST_F(DistributedInputSinkHandlerTest, InitSink01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, InitSink01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSinkHandler::GetInstance().InitSink("params");
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, InitSink02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, InitSink02, testing::ext::TestSize.Level1)
{
std::string params = "";
int32_t ret = DistributedInputSinkHandler::GetInstance().InitSink(params);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, InitSink03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, InitSink03, testing::ext::TestSize.Level1)
{
std::string params = "params";
int32_t ret = DistributedInputSinkHandler::GetInstance().InitSink(params);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, ReleaseSink01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, ReleaseSink01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSinkHandler::GetInstance().ReleaseSink();
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSinkHandler::GetInstance().SubscribeLocalHardware("dhId", "params");
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware02, testing::ext::TestSize.Level1)
{
std::string dhId = "SubscribeLocalHardware02";
std::string params = "test2";
@@ -78,7 +78,7 @@ HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware02, testing::ext
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware03, testing::ext::TestSize.Level1)
{
std::string dhId = "SubscribeLocalHardware03";
std::string params = "test3";
@@ -86,20 +86,20 @@ HWTEST_F(DistributedInputSinkHandlerTest, SubscribeLocalHardware03, testing::ext
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSinkHandler::GetInstance().UnsubscribeLocalHardware("dhId");
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware02, testing::ext::TestSize.Level1)
{
std::string dhId = "UnsubscribeLocalHardware02";
int32_t ret = DistributedInputSinkHandler::GetInstance().UnsubscribeLocalHardware(dhId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSinkHandlerTest, UnsubscribeLocalHardware03, testing::ext::TestSize.Level1)
{
std::string dhId = "UnsubscribeLocalHardware03";
int32_t ret = DistributedInputSinkHandler::GetInstance().UnsubscribeLocalHardware(dhId);
+1 -1
View File
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/source_handler"
module_out_path = unittest_output_path
group("unittest") {
testonly = true
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 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
@@ -51,26 +51,26 @@ int32_t DistributedInputSourceHandlerTest::TestUnregisterDInputCallback::OnUnreg
return DH_SUCCESS;
}
HWTEST_F(DistributedInputSourceHandlerTest, InitSource01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, InitSource01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSourceHandler::GetInstance().InitSource("");
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, InitSource02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, InitSource02, testing::ext::TestSize.Level1)
{
std::string dhId = "test";
int32_t ret = DistributedInputSourceHandler::GetInstance().InitSource(dhId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, ReleaseSource01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, ReleaseSource01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSourceHandler::GetInstance().ReleaseSource();
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware01, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestRegisterDInputCallback> registerCallback = std::make_shared<TestRegisterDInputCallback>();
int32_t ret = DistributedInputSourceHandler::GetInstance().RegisterDistributedHardware(
@@ -83,7 +83,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware01, testi
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware02, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestRegisterDInputCallback> registerCallback = nullptr;
std::string devId = "";
@@ -93,7 +93,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware02, testi
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware03, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestRegisterDInputCallback> registerCallback = std::make_shared<TestRegisterDInputCallback>();
int32_t ret = DistributedInputSourceHandler::GetInstance().RegisterDistributedHardware(
@@ -105,7 +105,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, RegisterDistributedHardware03, testi
registerCallback);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware01, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestUnregisterDInputCallback> unregisterDInputCallback =
std::make_shared<TestUnregisterDInputCallback>();
@@ -114,7 +114,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware01, tes
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware02, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware02, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestUnregisterDInputCallback> unregisterDInputCallback = nullptr;
std::string devId = "";
@@ -124,7 +124,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware02, tes
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware03, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware03, testing::ext::TestSize.Level1)
{
std::shared_ptr<TestUnregisterDInputCallback> unregisterDInputCallback =
std::make_shared<TestUnregisterDInputCallback>();
@@ -133,7 +133,7 @@ HWTEST_F(DistributedInputSourceHandlerTest, UnregisterDistributedHardware03, tes
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceHandlerTest, ConfigDistributedHardware01, testing::ext::TestSize.Level0)
HWTEST_F(DistributedInputSourceHandlerTest, ConfigDistributedHardware01, testing::ext::TestSize.Level1)
{
int32_t ret = DistributedInputSourceHandler::GetInstance().ConfigDistributedHardware("devId",
"dhId", "key", "value");
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
# Copyright (c) 2022-2025 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
@@ -15,7 +15,7 @@ import("//build/test.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
module_out_path = "distributed_input/utils"
module_out_path = unittest_output_path
group("unittest") {
testonly = true
+16 -16
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
* Copyright (c) 2022-2025 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
@@ -46,7 +46,7 @@ void DInputContextTest::TearDownTestCase()
{
}
HWTEST_F(DInputContextTest, GetSourceWindId001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, GetSourceWindId001, testing::ext::TestSize.Level1)
{
std::string devId = "hello";
uint64_t sourceWinId = 1;
@@ -54,14 +54,14 @@ HWTEST_F(DInputContextTest, GetSourceWindId001, testing::ext::TestSize.Level0)
EXPECT_EQ("hello###1", ret);
}
HWTEST_F(DInputContextTest, RemoveSinkScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, RemoveSinkScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
int32_t ret = DInputContext::GetInstance().RemoveSinkScreenInfo(sourceWinId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputContextTest, UpdateSinkScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, UpdateSinkScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SinkScreenInfo sinkScreenInfo;
@@ -69,7 +69,7 @@ HWTEST_F(DInputContextTest, UpdateSinkScreenInfo001, testing::ext::TestSize.Leve
EXPECT_EQ(ERR_DH_INPUT_CONTEXT_KEY_NOT_EXIST, ret);
}
HWTEST_F(DInputContextTest, UpdateSinkScreenInfo002, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, UpdateSinkScreenInfo002, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SinkScreenInfo sinkScreenInfo = DInputContext::GetInstance().GetSinkScreenInfo(sourceWinId);
@@ -78,7 +78,7 @@ HWTEST_F(DInputContextTest, UpdateSinkScreenInfo002, testing::ext::TestSize.Leve
DInputContext::GetInstance().RemoveSinkScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, GetSinkScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, GetSinkScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SinkScreenInfo sinkScreenInfo = DInputContext::GetInstance().GetSinkScreenInfo(sourceWinId);
@@ -86,7 +86,7 @@ HWTEST_F(DInputContextTest, GetSinkScreenInfo001, testing::ext::TestSize.Level0)
DInputContext::GetInstance().RemoveSinkScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, GetSinkScreenInfo002, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, GetSinkScreenInfo002, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SinkScreenInfo sinkScreenInfo1;
@@ -97,14 +97,14 @@ HWTEST_F(DInputContextTest, GetSinkScreenInfo002, testing::ext::TestSize.Level0)
DInputContext::GetInstance().RemoveSinkScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, RemoveSrcScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, RemoveSrcScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
int32_t ret = DInputContext::GetInstance().RemoveSrcScreenInfo(sourceWinId);
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DInputContextTest, UpdateSrcScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, UpdateSrcScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SrcScreenInfo srcScreenInfo;
@@ -112,7 +112,7 @@ HWTEST_F(DInputContextTest, UpdateSrcScreenInfo001, testing::ext::TestSize.Level
EXPECT_EQ(ERR_DH_INPUT_CONTEXT_KEY_NOT_EXIST, ret);
}
HWTEST_F(DInputContextTest, UpdateSrcScreenInfo002, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, UpdateSrcScreenInfo002, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SrcScreenInfo srcScreenInfo = DInputContext::GetInstance().GetSrcScreenInfo(sourceWinId);
@@ -121,7 +121,7 @@ HWTEST_F(DInputContextTest, UpdateSrcScreenInfo002, testing::ext::TestSize.Level
DInputContext::GetInstance().RemoveSrcScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, GetSrcScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, GetSrcScreenInfo001, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SrcScreenInfo srcScreenInfo = DInputContext::GetInstance().GetSrcScreenInfo(sourceWinId);
@@ -129,7 +129,7 @@ HWTEST_F(DInputContextTest, GetSrcScreenInfo001, testing::ext::TestSize.Level0)
DInputContext::GetInstance().RemoveSrcScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, GetSrcScreenInfo002, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, GetSrcScreenInfo002, testing::ext::TestSize.Level1)
{
std::string sourceWinId = "hello";
SrcScreenInfo srcScreenInfo1;
@@ -140,7 +140,7 @@ HWTEST_F(DInputContextTest, GetSrcScreenInfo002, testing::ext::TestSize.Level0)
DInputContext::GetInstance().RemoveSrcScreenInfo(sourceWinId);
}
HWTEST_F(DInputContextTest, SetGetLocalTouchScreenInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, SetGetLocalTouchScreenInfo001, testing::ext::TestSize.Level1)
{
LocalTouchScreenInfo localTouchScreenInfo;
localTouchScreenInfo.sinkShowWidth = HEIGHT;
@@ -148,14 +148,14 @@ HWTEST_F(DInputContextTest, SetGetLocalTouchScreenInfo001, testing::ext::TestSiz
EXPECT_EQ(HEIGHT, DInputContext::GetInstance().GetLocalTouchScreenInfo().sinkShowWidth);
}
HWTEST_F(DInputContextTest, CalculateTransformInfo001, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, CalculateTransformInfo001, testing::ext::TestSize.Level1)
{
SinkScreenInfo sinkScreenInfo;
int32_t ret = DInputContext::GetInstance().CalculateTransformInfo(sinkScreenInfo);
EXPECT_EQ(ERR_DH_INPUT_CONTEXT_CALCULATE_FAIL, ret);
}
HWTEST_F(DInputContextTest, CalculateTransformInfo002, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, CalculateTransformInfo002, testing::ext::TestSize.Level1)
{
SinkScreenInfo sinkScreenInfo;
sinkScreenInfo.sinkPhyHeight = 1080;
@@ -166,7 +166,7 @@ HWTEST_F(DInputContextTest, CalculateTransformInfo002, testing::ext::TestSize.Le
EXPECT_EQ(ERR_DH_INPUT_CONTEXT_CALCULATE_FAIL, ret);
}
HWTEST_F(DInputContextTest, CalculateTransformInfo003, testing::ext::TestSize.Level0)
HWTEST_F(DInputContextTest, CalculateTransformInfo003, testing::ext::TestSize.Level1)
{
SinkScreenInfo sinkScreenInfo;
sinkScreenInfo.sinkPhyHeight = 1080;