From adace72a07e27fb0b74d694b037957820359319a Mon Sep 17 00:00:00 2001 From: zhushuanghong Date: Fri, 14 Mar 2025 11:14:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?DT=E7=94=A8=E4=BE=8B=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhushuanghong --- frameworks/test/unittest/BUILD.gn | 2 +- .../test/unittest/src/workinfo_test.cpp | 20 +++++++++---------- .../work_scheduler_jsunittest/BUILD.gn | 2 +- services/test/BUILD.gn | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frameworks/test/unittest/BUILD.gn b/frameworks/test/unittest/BUILD.gn index de6cc06..f8c1773 100644 --- a/frameworks/test/unittest/BUILD.gn +++ b/frameworks/test/unittest/BUILD.gn @@ -14,7 +14,7 @@ import("//build/test.gni") import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") -module_output_path = "work_scheduler/work_info_unittest" +module_output_path = "work_scheduler/work_scheduler" ohos_systemtest("WorkSchedulerWorkInfoTest") { module_out_path = module_output_path diff --git a/frameworks/test/unittest/src/workinfo_test.cpp b/frameworks/test/unittest/src/workinfo_test.cpp index 742488d..9bf45f3 100644 --- a/frameworks/test/unittest/src/workinfo_test.cpp +++ b/frameworks/test/unittest/src/workinfo_test.cpp @@ -48,7 +48,7 @@ void WorkInfoTest::TearDown() * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest001, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest001, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.SetWorkId(1); @@ -61,7 +61,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest001, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest002, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest002, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.SetElement("bundle_name", "ability_name"); @@ -75,7 +75,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest002, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest003, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest003, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestPersisted(true); @@ -90,7 +90,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest003, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level3) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetChargerType(), WorkCondition::Charger::CHARGING_UNKNOWN); @@ -104,7 +104,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level3) { WorkInfo workInfo = WorkInfo(); workInfo.RequestChargerType(false, WorkCondition::Charger::CHARGING_UNPLUGGED); @@ -117,7 +117,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level3) { WorkInfo workInfo = WorkInfo(); workInfo.RequestBatteryStatus(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW_OR_OKAY); @@ -130,7 +130,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level4) { WorkInfo workInfo = WorkInfo(); workInfo.RequestBatteryStatus(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW); @@ -143,7 +143,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level4) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetBatteryStatus(), WorkCondition::BatteryStatus::BATTERY_UNKNOWN); @@ -157,7 +157,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN9 AR000GH89M */ -HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level4) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetStorageLevel(), WorkCondition::Storage::STORAGE_UNKNOWN); @@ -171,7 +171,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTN8 AR000GH89J AR000GH89K AR000GH89L */ -HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level) { WorkInfo workInfo = WorkInfo(); workInfo.RequestStorageLevel(WorkCondition::Storage::STORAGE_LEVEL_LOW); diff --git a/interfaces/test/unittest/work_scheduler_jsunittest/BUILD.gn b/interfaces/test/unittest/work_scheduler_jsunittest/BUILD.gn index 8f0e6ec..40b1a70 100644 --- a/interfaces/test/unittest/work_scheduler_jsunittest/BUILD.gn +++ b/interfaces/test/unittest/work_scheduler_jsunittest/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/test.gni") -module_output_path = "work_scheduler/interfaces" +module_output_path = "work_scheduler/work_scheduler" ohos_js_unittest("WorkSchedulerJsTest") { module_out_path = module_output_path diff --git a/services/test/BUILD.gn b/services/test/BUILD.gn index 6fe65a2..8473069 100644 --- a/services/test/BUILD.gn +++ b/services/test/BUILD.gn @@ -15,7 +15,7 @@ import("//build/config/features.gni") import("//build/test.gni") import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") -module_output_path = "work_scheduler/unittest" +module_output_path = "work_scheduler/work_scheduler" config("worksched_private_config") { include_dirs = [ "${worksched_service_path}/zidl/include", -- Gitee From 5313f630524b9488c6339ef884e9aac509b64ac9 Mon Sep 17 00:00:00 2001 From: zhushuanghong Date: Fri, 14 Mar 2025 14:12:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?DT=E7=94=A8=E4=BE=8B=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhushuanghong --- frameworks/test/unittest/src/workinfo_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/test/unittest/src/workinfo_test.cpp b/frameworks/test/unittest/src/workinfo_test.cpp index 9bf45f3..60f5236 100644 --- a/frameworks/test/unittest/src/workinfo_test.cpp +++ b/frameworks/test/unittest/src/workinfo_test.cpp @@ -171,7 +171,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level4) * @tc.type FUNC * @tc.require: SR000GGTN8 AR000GH89J AR000GH89K AR000GH89L */ -HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level) +HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level0) { WorkInfo workInfo = WorkInfo(); workInfo.RequestStorageLevel(WorkCondition::Storage::STORAGE_LEVEL_LOW); -- Gitee From e7b3cd7ca67f09eb8453e70f4ea602d6d42b152b Mon Sep 17 00:00:00 2001 From: zhushuanghong Date: Fri, 14 Mar 2025 14:59:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?DT=E7=94=A8=E4=BE=8B=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhushuanghong --- .../test/unittest/src/workinfo_test.cpp | 62 +++++++++---------- services/test/src/event_publisher_test.cpp | 4 +- .../src/scheduler_bg_task_subscriber_test.cpp | 2 +- services/test/src/watchdog_test.cpp | 10 +-- services/test/src/work_conn_manager_test.cpp | 24 +++---- services/test/src/work_sched_config_test.cpp | 2 +- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/frameworks/test/unittest/src/workinfo_test.cpp b/frameworks/test/unittest/src/workinfo_test.cpp index 60f5236..bcc1d25 100644 --- a/frameworks/test/unittest/src/workinfo_test.cpp +++ b/frameworks/test/unittest/src/workinfo_test.cpp @@ -90,7 +90,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest003, Function | MediumTest | Level2) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level3) +HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetChargerType(), WorkCondition::Charger::CHARGING_UNKNOWN); @@ -104,7 +104,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest004, Function | MediumTest | Level3) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level3) +HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestChargerType(false, WorkCondition::Charger::CHARGING_UNPLUGGED); @@ -117,7 +117,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest005, Function | MediumTest | Level3) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level3) +HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestBatteryStatus(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW_OR_OKAY); @@ -130,7 +130,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest006, Function | MediumTest | Level3) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level4) +HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestBatteryStatus(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW); @@ -143,7 +143,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest007, Function | MediumTest | Level4) * @tc.type FUNC * @tc.require: SR000GGTN6 AR000GH896 AR000GH897 AR000GH898 */ -HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level4) +HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetBatteryStatus(), WorkCondition::BatteryStatus::BATTERY_UNKNOWN); @@ -157,7 +157,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest008, Function | MediumTest | Level4) * @tc.type FUNC * @tc.require: SR000GGTN9 AR000GH89M */ -HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level4) +HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetStorageLevel(), WorkCondition::Storage::STORAGE_UNKNOWN); @@ -171,7 +171,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest009, Function | MediumTest | Level4) * @tc.type FUNC * @tc.require: SR000GGTN8 AR000GH89J AR000GH89K AR000GH89L */ -HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestStorageLevel(WorkCondition::Storage::STORAGE_LEVEL_LOW); @@ -184,7 +184,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest010, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTNB AR000GH89Q */ -HWTEST_F (WorkInfoTest, WorkInfoTest011, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest011, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RequestStorageLevel(WorkCondition::Storage::STORAGE_LEVEL_OKAY); @@ -197,7 +197,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest011, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTNA AR000GH89P AR000GH89N AR000GH89O */ -HWTEST_F (WorkInfoTest, WorkInfoTest012, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest012, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetNetworkType(), WorkCondition::Network::NETWORK_UNKNOWN); @@ -211,7 +211,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest012, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTNA AR000GH89P AR000GH89N AR000GH89O */ -HWTEST_F (WorkInfoTest, WorkInfoTest013, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest013, Function | MediumTest | Level2) { uint32_t timeInterval = 120; WorkInfo workInfo = WorkInfo(); @@ -229,7 +229,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest013, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: SR000GGTNA AR000GH89P AR000GH89N AR000GH89O */ -HWTEST_F (WorkInfoTest, WorkInfoTest014, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest014, Function | MediumTest | Level2) { uint32_t timeInterval = 120; WorkInfo workInfo = WorkInfo(); @@ -246,7 +246,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest014, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest015, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest015, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); EXPECT_EQ(workInfo.GetBatteryLevel(), INVALID_VALUE); @@ -260,7 +260,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest015, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest016, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest016, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.RefreshUid(0); @@ -273,7 +273,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest016, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest017, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest017, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); AAFwk::WantParams extras; @@ -292,7 +292,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest017, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest018, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest018, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.GetConditionMap(); @@ -307,7 +307,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest018, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson001, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson001, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); std::string res = workInfo.ParseToJsonStr(); @@ -345,7 +345,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson001, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson002, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson002, Function | MediumTest | Level2) { using namespace OHOS::WorkScheduler; WorkInfo workInfo = WorkInfo(); @@ -402,7 +402,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson002, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson003, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson003, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); Json::Value root; @@ -459,7 +459,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson003, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson004, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson004, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); Json::Value root; @@ -485,7 +485,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson004, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson005, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson005, Function | MediumTest | Level2) { using namespace OHOS::WorkScheduler; WorkInfo workInfo = WorkInfo(); @@ -512,7 +512,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson005, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTestJson006, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTestJson006, Function | MediumTest | Level2) { using namespace OHOS::WorkScheduler; WorkInfo workInfo = WorkInfo(); @@ -551,7 +551,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTestJson006, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest019, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest019, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.SetElement("bundle_name", "ability_name"); @@ -599,7 +599,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest019, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest020, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest020, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.SetElement("bundle_name", "ability_name"); @@ -632,7 +632,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest020, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest021, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest021, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); workInfo.SetCallBySystemApp(true); @@ -645,7 +645,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest021, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkInfoTest022, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkInfoTest022, Function | MediumTest | Level2) { WorkInfo workInfo = WorkInfo(); time_t result; @@ -661,7 +661,7 @@ HWTEST_F (WorkInfoTest, WorkInfoTest022, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkSchedUtils001, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkSchedUtils001, Function | MediumTest | Level2) { int32_t res = WorkSchedUtils::GetCurrentAccountId(); EXPECT_NE(res, -1000); @@ -673,7 +673,7 @@ HWTEST_F (WorkInfoTest, WorkSchedUtils001, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkSchedUtils002, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkSchedUtils002, Function | MediumTest | Level2) { bool res = WorkSchedUtils::IsIdActive(0); EXPECT_FALSE(res); @@ -685,7 +685,7 @@ HWTEST_F (WorkInfoTest, WorkSchedUtils002, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkSchedUtils003, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkSchedUtils003, Function | MediumTest | Level2) { int32_t res = WorkSchedUtils::GetUserIdByUid(1); EXPECT_EQ(res, 0); @@ -699,7 +699,7 @@ HWTEST_F (WorkInfoTest, WorkSchedUtils003, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkSchedUtils004, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkSchedUtils004, Function | MediumTest | Level2) { std::string partialPath; std::string fullPath; @@ -725,7 +725,7 @@ HWTEST_F (WorkInfoTest, WorkSchedUtils004, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F (WorkInfoTest, WorkSchedUtils006, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, WorkSchedUtils006, Function | MediumTest | Level2) { bool res = WorkSchedUtils::IsSystemApp(); EXPECT_EQ(res, false); @@ -737,7 +737,7 @@ HWTEST_F (WorkInfoTest, WorkSchedUtils006, Function | MediumTest | Level0) * @tc.type FUNC * @tc.require: issueIAHY0B */ -HWTEST_F (WorkInfoTest, GetSaId001, Function | MediumTest | Level0) +HWTEST_F (WorkInfoTest, GetSaId001, Function | MediumTest | Level2) { int32_t saId = 5300; WorkInfo workInfo = WorkInfo(); diff --git a/services/test/src/event_publisher_test.cpp b/services/test/src/event_publisher_test.cpp index 20a5729..dd74e88 100644 --- a/services/test/src/event_publisher_test.cpp +++ b/services/test/src/event_publisher_test.cpp @@ -46,7 +46,7 @@ void EventPublisherTest::SetUpTestCase() * @tc.type: FUNC * @tc.require: I8GHCL */ -HWTEST_F(EventPublisherTest, publishEvent_001, TestSize.Level1) +HWTEST_F(EventPublisherTest, publishEvent_001, TestSize.Level3) { std::string result; std::string eventType; @@ -55,7 +55,7 @@ HWTEST_F(EventPublisherTest, publishEvent_001, TestSize.Level1) EXPECT_EQ(result, std::string("dump -d need right params.")); } -HWTEST_F(EventPublisherTest, Dump_001, TestSize.Level1) +HWTEST_F(EventPublisherTest, Dump_001, TestSize.Level3) { std::vector> infos = { {"event", "info"}, diff --git a/services/test/src/scheduler_bg_task_subscriber_test.cpp b/services/test/src/scheduler_bg_task_subscriber_test.cpp index 0bc4b04..70115ba 100644 --- a/services/test/src/scheduler_bg_task_subscriber_test.cpp +++ b/services/test/src/scheduler_bg_task_subscriber_test.cpp @@ -45,7 +45,7 @@ void SchedulerBgTaskSubscriberTest::SetUpTestCase() * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(SchedulerBgTaskSubscriberTest, OnRemoteDied_001, TestSize.Level1) +HWTEST_F(SchedulerBgTaskSubscriberTest, OnRemoteDied_001, TestSize.Level3) { schedulerBgTaskSubscriber_->OnRemoteDied(nullptr); EXPECT_TRUE(schedulerBgTaskSubscriber_ != nullptr); diff --git a/services/test/src/watchdog_test.cpp b/services/test/src/watchdog_test.cpp index aacb57c..b3dd56b 100644 --- a/services/test/src/watchdog_test.cpp +++ b/services/test/src/watchdog_test.cpp @@ -49,7 +49,7 @@ void WatchdogTest::SetUpTestCase() * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(WatchdogTest, watchdog_001, TestSize.Level1) +HWTEST_F(WatchdogTest, watchdog_001, TestSize.Level3) { bool result = watchdog_->AddWatchdog(1, 1); EXPECT_EQ(result, false); @@ -61,7 +61,7 @@ HWTEST_F(WatchdogTest, watchdog_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(WatchdogTest, watchdog_002, TestSize.Level1) +HWTEST_F(WatchdogTest, watchdog_002, TestSize.Level3) { bool result = watchdog_->AddWatchdog(1, 1); EXPECT_EQ(result, false); @@ -74,7 +74,7 @@ HWTEST_F(WatchdogTest, watchdog_002, TestSize.Level1) * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(WatchdogTest, watchdog_003, TestSize.Level1) +HWTEST_F(WatchdogTest, watchdog_003, TestSize.Level3) { AppExecFwk::InnerEvent::Pointer event = AppExecFwk::InnerEvent::Get(0); event = nullptr; @@ -88,7 +88,7 @@ HWTEST_F(WatchdogTest, watchdog_003, TestSize.Level1) * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(WatchdogTest, watchdog_004, TestSize.Level1) +HWTEST_F(WatchdogTest, watchdog_004, TestSize.Level3) { AppExecFwk::InnerEvent::Pointer event = AppExecFwk::InnerEvent::Get(0); watchdog_->ProcessEvent(event); @@ -101,7 +101,7 @@ HWTEST_F(WatchdogTest, watchdog_004, TestSize.Level1) * @tc.type: FUNC * @tc.require: I8JBRY */ -HWTEST_F(WatchdogTest, watchdog_005, TestSize.Level1) +HWTEST_F(WatchdogTest, watchdog_005, TestSize.Level3) { AppExecFwk::InnerEvent::Pointer event = AppExecFwk::InnerEvent::Get(0); watchdog_->service_ = nullptr; diff --git a/services/test/src/work_conn_manager_test.cpp b/services/test/src/work_conn_manager_test.cpp index 3452515..a520f3f 100644 --- a/services/test/src/work_conn_manager_test.cpp +++ b/services/test/src/work_conn_manager_test.cpp @@ -54,7 +54,7 @@ void WorkConnManagerTest::SetUpTestCase() * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, AddConnInfo_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, AddConnInfo_001, TestSize.Level2) { string workId = "u1000_123"; sptr connection; @@ -68,7 +68,7 @@ HWTEST_F(WorkConnManagerTest, AddConnInfo_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, RemoveConnInfo_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, RemoveConnInfo_001, TestSize.Level2) { string workId = "u1000_123"; sptr connection; @@ -83,7 +83,7 @@ HWTEST_F(WorkConnManagerTest, RemoveConnInfo_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, GetConnInfo_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, GetConnInfo_001, TestSize.Level2) { string workId = "u1000_123"; sptr connection; @@ -98,7 +98,7 @@ HWTEST_F(WorkConnManagerTest, GetConnInfo_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, GetConnInfo_002, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, GetConnInfo_002, TestSize.Level2) { workConnManager_->connMap_.clear(); string workId = "u1000_123"; @@ -112,7 +112,7 @@ HWTEST_F(WorkConnManagerTest, GetConnInfo_002, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StartWork_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StartWork_001, TestSize.Level2) { string workId = "u1000_123"; sptr connection; @@ -134,7 +134,7 @@ HWTEST_F(WorkConnManagerTest, StartWork_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StartWork_002, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StartWork_002, TestSize.Level2) { WorkInfo workInfo; workInfo.workId_ = 123; @@ -152,7 +152,7 @@ HWTEST_F(WorkConnManagerTest, StartWork_002, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, DisConnect_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, DisConnect_001, TestSize.Level2) { sptr connection; bool ret = workConnManager_->DisConnect(connection); @@ -165,7 +165,7 @@ HWTEST_F(WorkConnManagerTest, DisConnect_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StopWork_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StopWork_001, TestSize.Level2) { workConnManager_->connMap_.clear(); WorkInfo workInfo; @@ -184,7 +184,7 @@ HWTEST_F(WorkConnManagerTest, StopWork_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StopWork_002, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StopWork_002, TestSize.Level2) { string workId = "u1000_123"; sptr connection; @@ -206,7 +206,7 @@ HWTEST_F(WorkConnManagerTest, StopWork_002, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StopWork_003, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StopWork_003, TestSize.Level2) { MyWorkConnManager myWorkConnManager; @@ -231,7 +231,7 @@ HWTEST_F(WorkConnManagerTest, StopWork_003, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, StopWork_004, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, StopWork_004, TestSize.Level2) { MyWorkConnManager myWorkConnManager; @@ -256,7 +256,7 @@ HWTEST_F(WorkConnManagerTest, StopWork_004, TestSize.Level1) * @tc.type: FUNC * @tc.require: #I9HYBW */ -HWTEST_F(WorkConnManagerTest, WriteStartWorkEvent_001, TestSize.Level1) +HWTEST_F(WorkConnManagerTest, WriteStartWorkEvent_001, TestSize.Level2) { WorkInfo workInfo; workInfo.workId_ = 123; diff --git a/services/test/src/work_sched_config_test.cpp b/services/test/src/work_sched_config_test.cpp index 128aa89..f19a044 100644 --- a/services/test/src/work_sched_config_test.cpp +++ b/services/test/src/work_sched_config_test.cpp @@ -45,7 +45,7 @@ public: * @tc.type: FUNC * @tc.require: I8GHCL */ -HWTEST_F(WorkSchedConfigTest, InitActiveGroupWhitelist_001, TestSize.Level1) +HWTEST_F(WorkSchedConfigTest, InitActiveGroupWhitelist_001, TestSize.Level3) { std::string configData = ""; DelayedSingleton::GetInstance()->InitActiveGroupWhitelist(configData); -- Gitee From 0c0327041c4f92ce69b80c42aecf2bee4aff9966 Mon Sep 17 00:00:00 2001 From: zhushuanghong Date: Fri, 14 Mar 2025 15:04:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?DT=E7=94=A8=E4=BE=8B=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhushuanghong --- .../unittest/src/work_sched_client_test.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/frameworks/test/unittest/src/work_sched_client_test.cpp b/frameworks/test/unittest/src/work_sched_client_test.cpp index e5cc3cd..c0826ae 100644 --- a/frameworks/test/unittest/src/work_sched_client_test.cpp +++ b/frameworks/test/unittest/src/work_sched_client_test.cpp @@ -40,7 +40,7 @@ public: * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_001, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_001, TestSize.Level0) { WorkInfo workInfo = WorkInfo(); auto ret = WorkSchedulerSrvClient::GetInstance().StartWork(workInfo); @@ -53,7 +53,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_001, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_002, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_002, TestSize.Level0) { WorkInfo workInfo = WorkInfo(); auto ret = WorkSchedulerSrvClient::GetInstance().StopWork(workInfo); @@ -66,7 +66,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_002, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_003, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_003, TestSize.Level0) { WorkInfo workInfo = WorkInfo(); auto ret = WorkSchedulerSrvClient::GetInstance().StopAndCancelWork(workInfo); @@ -79,7 +79,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_003, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_004, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_004, TestSize.Level0) { auto ret = WorkSchedulerSrvClient::GetInstance().StopAndClearWorks(); EXPECT_EQ(ret, ERR_OK); @@ -91,7 +91,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_004, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_005, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_005, TestSize.Level0) { int32_t workId = 1; bool result; @@ -105,7 +105,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_005, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_006, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_006, TestSize.Level0) { int32_t workId = 1; std::shared_ptr work; @@ -122,7 +122,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_006, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_007, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_007, TestSize.Level0) { std::list> workInfos; ErrCode ret = WorkSchedulerSrvClient::GetInstance().ObtainAllWorks(workInfos); @@ -135,7 +135,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_007, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_008, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_008, TestSize.Level0) { sptr sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); sptr remoteObject_ = sam->CheckSystemAbility(WORK_SCHEDULE_SERVICE_ID); @@ -153,7 +153,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_008, TestSize.Level1) * @tc.type: FUNC * @tc.require: issueI5Y6YK */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_009, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_009, TestSize.Level0) { sptr sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); sptr remoteObject_ = sam->CheckSystemAbility(WORK_SCHEDULE_SERVICE_ID); @@ -169,7 +169,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_009, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I992IA */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_010, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_010, TestSize.Level0) { int32_t uid = -1; ErrCode ret = WorkSchedulerSrvClient::GetInstance().PauseRunningWorks(uid); @@ -182,7 +182,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_010, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I992IA */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_011, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_011, TestSize.Level0) { int32_t uid = IPCSkeleton::GetCallingUid(); ErrCode ret = WorkSchedulerSrvClient::GetInstance().PauseRunningWorks(uid); @@ -195,7 +195,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_011, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I992IA */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_012, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_012, TestSize.Level0) { int32_t uid = -1; ErrCode ret = WorkSchedulerSrvClient::GetInstance().ResumePausedWorks(uid); @@ -208,7 +208,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_012, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I992IA */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_013, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_013, TestSize.Level0) { int32_t uid = IPCSkeleton::GetCallingUid(); ErrCode ret = WorkSchedulerSrvClient::GetInstance().ResumePausedWorks(uid); @@ -221,7 +221,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_013, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I9EKGI */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_014, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_014, TestSize.Level0) { std::list> workInfos; ErrCode ret = WorkSchedulerSrvClient::GetInstance().GetAllRunningWorks(workInfos); @@ -234,7 +234,7 @@ HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_014, TestSize.Level1) * @tc.type: FUNC * @tc.require: issue:#I9EKGI */ -HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_015, TestSize.Level1) +HWTEST_F(WorkSchedClientTest, WorkSchedClientTest_015, TestSize.Level0) { int32_t sourceType = 1; std::string configData = ""; -- Gitee