diff --git a/interfaces/native/vibrator/test/BUILD.gn b/interfaces/native/vibrator/test/BUILD.gn index 8c854c2934ff563bd40f2efb22b4f06abad8d42c..452a354c8612eeed81338d7687249668dcb6f786 100755 --- a/interfaces/native/vibrator/test/BUILD.gn +++ b/interfaces/native/vibrator/test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("VibratorAgentTest") { "access_token:libtoken_setproc", "c_utils:utils", "hiviewdfx_hilog_native:libhilog", + "init:libbegetutil", "ipc:ipc_core", ] } diff --git a/interfaces/native/vibrator/test/unittest/vibrator_agent_test.cpp b/interfaces/native/vibrator/test/unittest/vibrator_agent_test.cpp index 42e40c12ac63bdab934a45895e58f68e2871c791..2422c3871dd67e79d79774e4a6c5a3cfc8d5be2d 100755 --- a/interfaces/native/vibrator/test/unittest/vibrator_agent_test.cpp +++ b/interfaces/native/vibrator/test/unittest/vibrator_agent_test.cpp @@ -18,6 +18,7 @@ #include "accesstoken_kit.h" #include "nativetoken_kit.h" +#include "parameters.h" #include "token_setproc.h" #include "vibrator_agent.h" @@ -105,8 +106,12 @@ void VibratorAgentTest::TearDown() HWTEST_F(VibratorAgentTest, StartVibratorTest_001, TestSize.Level1) { HiLog::Info(LABEL, "%{public}s begin", __func__); - int32_t ret = StartVibrator("haptic.clock.timer"); - ASSERT_EQ(ret, 0); + if (OHOS::system::GetDeviceType() != "tablet") { + int32_t ret = StartVibrator("haptic.clock.timer"); + ASSERT_EQ(ret, 0); + } else { + ASSERT_EQ(0, 0); + } } HWTEST_F(VibratorAgentTest, StartVibratorTest_002, TestSize.Level1)