!914 fix: add xts test for interface GetWakeupReason

Merge pull request !914 from yangshuxiang/master
This commit is contained in:
openharmony_ci 2023-12-21 07:45:37 +00:00 committed by Gitee
commit 6b20e6f191
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 25 additions and 1 deletions

View File

@ -14,4 +14,5 @@ import("//build/ohos.gni")
declare_args() {
hats_rich = false
hats_nnrt = false
hats_drivers_peripheral_power_wakeup_cause_path = false
}

View File

@ -15,7 +15,8 @@
"syscap": [],
"features": [
"hats_rich",
"hats_nnrt"
"hats_nnrt",
"hats_drivers_peripheral_power_wakeup_cause_path"
],
"adapted_system_type": [
"mini",

View File

@ -13,6 +13,7 @@
import("//build/ohos_var.gni")
import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
import("//test/xts/hats/build.gni")
import("//test/xts/tools/build/suite.gni")
ohos_moduletest_suite("HatsPowermgrPowerTest") {
@ -29,6 +30,11 @@ ohos_moduletest_suite("HatsPowermgrPowerTest") {
"hilog:libhilog",
"ipc:ipc_single",
]
if (hats_drivers_peripheral_power_wakeup_cause_path) {
defines = [ "HATS_DRIVER_PERIPHERAL_POWER_WAKEUP_CAUSE_PATH" ]
}
subsystem_name = "xts"
part_name = "hats"
}

View File

@ -641,4 +641,20 @@ HWTEST_F(HdfPowerHdiTest, HdfPowerHdiTest037, TestSize.Level3)
EXPECT_TRUE(OHOS::HDI::Power::V1_1::RunningLockType::RUNNINGLOCK_BUTT == 66);
printf("HdfPowerHdiTest037: end.");
}
/**
* @tc.name: HdfPowerHdiTest038
* @tc.desc: check GetWakeupReason
* @tc.type: FUNC
*/
HWTEST_F(HdfPowerHdiTest, HdfPowerHdiTest038, TestSize.Level1)
{
std::string testName = "HdfPowerHdiTest038";
int32_t ret = g_powerInterface->GetWakeupReason(testName);
#ifdef HATS_DRIVER_PERIPHERAL_POWER_WAKEUP_CAUSE_PATH
EXPECT_EQ(0, ret);
#else
EXPECT_NE(0, ret);
#endif
}
}