diff --git a/frameworks/acfwk/test/mock/src/mock_service_registry.cpp b/frameworks/acfwk/test/mock/src/mock_service_registry.cpp index bf18319f..9a97db1d 100644 --- a/frameworks/acfwk/test/mock/src/mock_service_registry.cpp +++ b/frameworks/acfwk/test/mock/src/mock_service_registry.cpp @@ -75,7 +75,8 @@ sptr SystemAbilityManagerProxy::CheckSystemAbilityWrapper(int32_t sptr SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId) { (void)systemAbilityId; - return nullptr; + sptr remote = new OHOS::Accessibility::MockAccessibleAbilityManagerServiceStub(); + return remote; } sptr SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, const std::string& deviceId) diff --git a/services/aams/test/unittest/accessibility_account_data_test.cpp b/services/aams/test/unittest/accessibility_account_data_test.cpp index d639692a..394a95fc 100644 --- a/services/aams/test/unittest/accessibility_account_data_test.cpp +++ b/services/aams/test/unittest/accessibility_account_data_test.cpp @@ -599,8 +599,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetEnab accountData->Init(); bool state = true; - bool test = accountData->GetConfig()->SetEnabled(state); - EXPECT_TRUE(test); + RetError test = accountData->GetConfig()->SetEnabled(state); + EXPECT_EQ(test, RET_OK); GTEST_LOG_(INFO) << "AccessibilityAccountData_Unittest_SetEnabled end"; } @@ -923,8 +923,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetTouc accountData->Init(); bool state = true; - bool test = accountData->GetConfig()->SetTouchGuideState(state); - EXPECT_TRUE(test); + RetError test = accountData->GetConfig()->SetTouchGuideState(state); + EXPECT_EQ(test, RET_OK); bool result = accountData->GetConfig()->GetTouchGuideState(); EXPECT_TRUE(result); @@ -940,8 +940,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetGest accountData->Init(); bool state = false; - bool test = accountData->GetConfig()->SetGestureState(state); - EXPECT_TRUE(test); + RetError test = accountData->GetConfig()->SetGestureState(state); + EXPECT_EQ(test, RET_OK); bool result = accountData->GetConfig()->GetGestureState(); EXPECT_FALSE(result); @@ -957,8 +957,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetKeyE accountData->Init(); bool state = true; - bool test = accountData->GetConfig()->SetKeyEventObserverState(state); - EXPECT_TRUE(test); + RetError test = accountData->GetConfig()->SetKeyEventObserverState(state); + EXPECT_EQ(test, RET_OK); bool result = accountData->GetConfig()->GetKeyEventObserverState(); EXPECT_TRUE(result); diff --git a/services/aams/test/unittest/accessibility_window_manager_test.cpp b/services/aams/test/unittest/accessibility_window_manager_test.cpp index 957ac4dd..6b9b9300 100644 --- a/services/aams/test/unittest/accessibility_window_manager_test.cpp +++ b/services/aams/test/unittest/accessibility_window_manager_test.cpp @@ -915,6 +915,8 @@ HWTEST_F(AccessibilityWindowManagerTest, AccessibilityWindowManager_Unittest_OnW sptr rosen_winInfo_second = GetRosenWindowInfo(Rosen::WindowType::APP_WINDOW_BASE); rosen_winInfo_second->bundleName_ = "rosen_winInfo_second"; rosen_winInfo_second->touchHotAreas_ = {Rosen::Rect{0, 0, 3, 3}, Rosen::Rect{3, 3, 6, 6}}; + rosen_winInfo_second->wid_ = 2; + rosen_winInfo_second->innerWid_ = 2; std::vector> infos; infos.emplace_back(rosen_winInfo_first); infos.emplace_back(rosen_winInfo_second);