From fd9edc415fb2d42d81d60579cbe5f63eed385638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98w50052426=E2=80=99?= Date: Mon, 4 Aug 2025 17:37:25 +0800 Subject: [PATCH 1/3] description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ‘w50052426’ --- .../module_loader/test/mmi_service_test.cpp | 512 ++++++++++++++++++ 1 file changed, 512 insertions(+) diff --git a/service/module_loader/test/mmi_service_test.cpp b/service/module_loader/test/mmi_service_test.cpp index 4d579da2c7..0c89036636 100644 --- a/service/module_loader/test/mmi_service_test.cpp +++ b/service/module_loader/test/mmi_service_test.cpp @@ -5062,5 +5062,517 @@ HWTEST_F(MMIServerTest, MMIService_QueryPointerRecord_002, TestSize.Level1) ErrCode ret = mmiService.QueryPointerRecord(10, pointerList); EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ERROR_NO_PERMISSION || ret == ETASKS_POST_SYNCTASK_FAIL); } + +/** + * @tc.name: MMIServerTest_SetPointerColor_002 + * @tc.desc: Non-system applications calling SetPointerSpeed should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SetPointerColor_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t ret = mmiService.SetPointerColor(0xFF0000); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIService_SetCustomCursorPixelMap_001 + * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SetCustomCursorPixelMap_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t windowId = 0; + int32_t focusX = 0; + int32_t focusY = 0; + CursorPixelMap curPixelMap; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + ErrCode ret = mmiService.SetCustomCursorPixelMap(windowId, focusX, focusY, curPixelMap); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_SetMouseHotSpot_001 + * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SetMouseHotSpot_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t pid = 1234; + int32_t windowId = -1; + int32_t hotSpotX = 10; + int32_t hotSpotY = 10; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + ErrCode ret = mmiService.SetMouseHotSpot(pid, windowId, hotSpotX, hotSpotY); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_ClearWindowPointerStyle_001 + * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_ClearWindowPointerStyle_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t pid = 1234; + int32_t windowId = -1; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + ErrCode ret = mmiService.ClearWindowPointerStyle(pid, windowId); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_SetMouseCaptureMode_001 + * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SetMouseCaptureMode_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t windowId = 0; + bool isCaptureMode = true; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + ErrCode ret = mmiService.SetMouseCaptureMode(windowId, isCaptureMode); + EXPECT_EQ(ret, RET_ERR); +} + + +/** + * @tc.name: MMIService_SupportKeys_001 + * @tc.desc: Invalid deviceId: deviceId < 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SupportKeys_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t deviceId = -1; + std::vector keys = {1, 2, 3}; + std::vector keystroke; + ErrCode ret = mmiService.SupportKeys(deviceId, keys, keystroke); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_SupportKeys_002 + * @tc.desc: Invalid keys size: keys size > maximum limit, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SupportKeys_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t deviceId = 1; + std::vector keys(ExtraData::MAX_BUFFER_SIZE + 1, 1); + std::vector keystroke; + ErrCode ret = mmiService.SupportKeys(deviceId, keys, keystroke); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_SupportKeys_003 + * @tc.desc: Invalid keys size: keys size = 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_SupportKeys_003, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t deviceId = 1; + std::vector keys = {}; + std::vector keystroke; + ErrCode ret = mmiService.SupportKeys(deviceId, keys, keystroke); + int32_t returnCode = 65142804; + EXPECT_EQ(ret, returnCode); +} + +/** + * @tc.name: MMIService_GetKeyboardType_001 + * @tc.desc: Invalid deviceId: deviceId < 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_GetKeyboardType_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t deviceId = -1; + int32_t keyboardType = 0; + ErrCode ret = mmiService.GetKeyboardType(deviceId, keyboardType); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_UnsubscribeHotkey_001 + * @tc.desc: Invalid subscribeId: subscribeId < 0, should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_UnsubscribeHotkey_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t subscribeId = -1; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + ErrCode ret = mmiService.UnsubscribeHotkey(subscribeId); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIService_AddGestureMonitor_001 + * @tc.desc: Test AddGestureMonitor when service is not running + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_AddGestureMonitor_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_NOT_START; + int32_t handlerType = 1; + uint32_t eventType = 1; + uint32_t gestureType = 1; + int32_t fingers = 1; + ErrCode ret = mmiService.AddGestureMonitor(handlerType, eventType, gestureType, fingers); + EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); +} + +/** + * @tc.name: MMIService_RemoveGestureMonitor_001 + * @tc.desc: Test RemoveGestureMonitor when service is not running + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_RemoveGestureMonitor_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_NOT_START; + int32_t handlerType = 1; + uint32_t eventType = 1; + uint32_t gestureType = 1; + int32_t fingers = 1; + ErrCode ret = mmiService.RemoveGestureMonitor(handlerType, eventType, gestureType, fingers); + EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); +} + +/** + * @tc.name: MMIService_UnsubscribeSwitchEvent_001 + * @tc.desc: Test UnsubscribeSwitchEvent when service is not running + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_UnsubscribeSwitchEvent_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_NOT_START; + int32_t subscribeId = 1; + ErrCode ret = mmiService.UnsubscribeSwitchEvent(subscribeId); + EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); +} + +/** + * @tc.name: MMIServerTest_SetMouseScrollRows_002 + * @tc.desc: Non-system applications calling SetPointerSpeed should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SetMouseScrollRows_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t rows = 1; + int32_t ret = mmiService.SetMouseScrollRows(rows); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetMouseScrollRows_002 + * @tc.desc: Non-system applications calling GetMouseScrollRows should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetMouseScrollRows_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t rows = 0; + int32_t ret = mmiService.GetMouseScrollRows(rows); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_SetPointerSize_002 + * @tc.desc: Non-system applications calling SetPointerSize should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SetPointerSize_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t size = 1; + int32_t ret = mmiService.SetPointerSize(size); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetPointerSize_002 + * @tc.desc: Non-system applications calling GetPointerSize should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetPointerSize_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t size = 0; + int32_t ret = mmiService.GetPointerSize(size); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetCursorSurfaceId_002 + * @tc.desc: Non-system applications calling GetCursorSurfaceId should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetCursorSurfaceId_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + uint64_t surfaceId = 0; + int32_t ret = mmiService.GetCursorSurfaceId(surfaceId); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_SetPointerColor_003 + * @tc.desc: Non-system applications calling SetPointerColor should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SetPointerColor_003, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t color = 0xFFFFFFFF; + int32_t ret = mmiService.SetPointerColor(color); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetPointerColor_002 + * @tc.desc: Non-system applications calling GetPointerColor should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetPointerColor_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t color = 0; + int32_t ret = mmiService.GetPointerColor(color); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_SetKeyboardRepeatRate_002 + * @tc.desc: Non-system applications calling SetKeyboardRepeatRate should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SetKeyboardRepeatRate_002, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t rate = 100; // 例如,设置为 100 + int32_t ret = mmiService.SetKeyboardRepeatRate(rate); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetKeyboardRepeatDelay_001 + * @tc.desc: Non-system applications calling GetKeyboardRepeatDelay should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatDelay_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t delay = 0; + int32_t ret = mmiService.GetKeyboardRepeatDelay(delay); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_GetKeyboardRepeatRate_001 + * @tc.desc: Non-system applications calling GetKeyboardRepeatRate should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatRate_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t rate = 0; + int32_t ret = mmiService.GetKeyboardRepeatRate(rate); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_SubscribeKeyEvent_001 + * @tc.desc: Non-system applications calling SubscribeKeyEvent should return ERROR_NOT_SYSAPI + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_SubscribeKeyEvent_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t subscribeId = 123; + KeyOption keyOption; + int32_t ret = mmiService.SubscribeKeyEvent(subscribeId, keyOption); + EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_AddPreInputHandler_004 + * @tc.desc: Verify AddPreInputHandler returns RET_OK in normal running condition + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_AddPreInputHandler_004, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t handlerId = 1001; + uint32_t eventType = 1; + std::vector keys = { 1, 2, 3 }; + ErrCode ret = mmiService.AddPreInputHandler(handlerId, eventType, keys); + EXPECT_EQ(ret, ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_AddPreInputHandler_005 + * @tc.desc: Invalid keys.size(), should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_AddPreInputHandler_005, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t handlerId = 1001; + uint32_t eventType = 1; + std::vector keys = {}; + ErrCode ret = mmiService.AddPreInputHandler(handlerId, eventType, keys); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIServerTest_AddPreInputHandler_006 + * @tc.desc: Invalid keys.size(), should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_AddPreInputHandler_006, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t handlerId = 1001; + uint32_t eventType = 1; + std::vector keys(10, 0); + ErrCode ret = mmiService.AddPreInputHandler(handlerId, eventType, keys); + EXPECT_EQ(ret, RET_ERR); +} + +/** + * @tc.name: MMIServerTest_RemovePreInputHandler_003 + * @tc.desc: Verify RemovePreInputHandler returns RET_OK in normal running condition + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_RemovePreInputHandler_003, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + mmiService.state_ = ServiceRunningState::STATE_RUNNING; + int32_t handlerId = 1001; + ErrCode ret = mmiService.RemovePreInputHandler(handlerId); + EXPECT_EQ(ret, ETASKS_POST_SYNCTASK_FAIL); +} + +/** + * @tc.name: MMIServerTest_OnSupportKeys_001 + * @tc.desc: Invalid keys.size(), should return RET_ERR + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIServerTest_OnSupportKeys_001, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + int32_t deviceId = 1; + std::vector keys{ 1 }; + std::vector keystroke(MAX_SUPPORT_KEY + 10, true); + int32_t ret = mmiService.OnSupportKeys(deviceId, keys, keystroke); + int32_t returnCode = 401; + EXPECT_EQ(ret, returnCode); +} + +/** + * @tc.name: MMIService_AppendExtraData_003 + * @tc.desc: Invalid extraData.buffer.size(), should return ERROR_OVER_SIZE_BUFFER + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MMIServerTest, MMIService_AppendExtraData_003, TestSize.Level1) +{ + CALL_TEST_DEBUG; + MMIService mmiService; + ExtraData data; + data.sourceType = InputEvent::SOURCE_TYPE_TOUCHSCREEN; + data.pointerId = 0; + data.pullId = 0; + data.eventId = 100; + data.buffer.resize(ExtraData::MAX_BUFFER_SIZE + 1); + int32_t returnCode = 65142800; + int32_t ret = mmiService.AppendExtraData(data); + EXPECT_EQ(ret, returnCode); +} } // namespace MMI } // namespace OHOS \ No newline at end of file -- Gitee From ccd45601fb5c18bac4727b6b885e319698a684eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98w50052426=E2=80=99?= Date: Tue, 5 Aug 2025 16:50:46 +0800 Subject: [PATCH 2/3] description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ‘w50052426’ --- .../module_loader/test/mmi_service_test.cpp | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/service/module_loader/test/mmi_service_test.cpp b/service/module_loader/test/mmi_service_test.cpp index 0c89036636..dc760e0905 100644 --- a/service/module_loader/test/mmi_service_test.cpp +++ b/service/module_loader/test/mmi_service_test.cpp @@ -5079,12 +5079,12 @@ HWTEST_F(MMIServerTest, MMIServerTest_SetPointerColor_002, TestSize.Level1) } /** - * @tc.name: MMIService_SetCustomCursorPixelMap_001 + * @tc.name: MMIService_SetCustomCursorPixelMap_002 * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SetCustomCursorPixelMap_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SetCustomCursorPixelMap_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5098,12 +5098,12 @@ HWTEST_F(MMIServerTest, MMIService_SetCustomCursorPixelMap_001, TestSize.Level1) } /** - * @tc.name: MMIService_SetMouseHotSpot_001 + * @tc.name: MMIService_SetMouseHotSpot_002 * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SetMouseHotSpot_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SetMouseHotSpot_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5117,12 +5117,12 @@ HWTEST_F(MMIServerTest, MMIService_SetMouseHotSpot_001, TestSize.Level1) } /** - * @tc.name: MMIService_ClearWindowPointerStyle_001 + * @tc.name: MMIService_ClearWindowPointerStyle_002 * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_ClearWindowPointerStyle_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_ClearWindowPointerStyle_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5134,12 +5134,12 @@ HWTEST_F(MMIServerTest, MMIService_ClearWindowPointerStyle_001, TestSize.Level1) } /** - * @tc.name: MMIService_SetMouseCaptureMode_001 + * @tc.name: MMIService_SetMouseCaptureMode_002 * @tc.desc: Invalid windowId: windowId <= 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SetMouseCaptureMode_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SetMouseCaptureMode_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5150,14 +5150,13 @@ HWTEST_F(MMIServerTest, MMIService_SetMouseCaptureMode_001, TestSize.Level1) EXPECT_EQ(ret, RET_ERR); } - /** - * @tc.name: MMIService_SupportKeys_001 + * @tc.name: MMIService_SupportKeys_002 * @tc.desc: Invalid deviceId: deviceId < 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SupportKeys_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SupportKeys_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5169,12 +5168,12 @@ HWTEST_F(MMIServerTest, MMIService_SupportKeys_001, TestSize.Level1) } /** - * @tc.name: MMIService_SupportKeys_002 + * @tc.name: MMIService_SupportKeys_003 * @tc.desc: Invalid keys size: keys size > maximum limit, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SupportKeys_002, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SupportKeys_003, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5186,12 +5185,12 @@ HWTEST_F(MMIServerTest, MMIService_SupportKeys_002, TestSize.Level1) } /** - * @tc.name: MMIService_SupportKeys_003 + * @tc.name: MMIService_SupportKeys_004 * @tc.desc: Invalid keys size: keys size = 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_SupportKeys_003, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_SupportKeys_004, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5204,12 +5203,12 @@ HWTEST_F(MMIServerTest, MMIService_SupportKeys_003, TestSize.Level1) } /** - * @tc.name: MMIService_GetKeyboardType_001 + * @tc.name: MMIService_GetKeyboardType_002 * @tc.desc: Invalid deviceId: deviceId < 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_GetKeyboardType_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_GetKeyboardType_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5220,12 +5219,12 @@ HWTEST_F(MMIServerTest, MMIService_GetKeyboardType_001, TestSize.Level1) } /** - * @tc.name: MMIService_UnsubscribeHotkey_001 + * @tc.name: MMIService_UnsubscribeHotkey_003 * @tc.desc: Invalid subscribeId: subscribeId < 0, should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_UnsubscribeHotkey_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_UnsubscribeHotkey_003, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5236,12 +5235,12 @@ HWTEST_F(MMIServerTest, MMIService_UnsubscribeHotkey_001, TestSize.Level1) } /** - * @tc.name: MMIService_AddGestureMonitor_001 + * @tc.name: MMIService_AddGestureMonitor_002 * @tc.desc: Test AddGestureMonitor when service is not running * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_AddGestureMonitor_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_AddGestureMonitor_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5255,12 +5254,12 @@ HWTEST_F(MMIServerTest, MMIService_AddGestureMonitor_001, TestSize.Level1) } /** - * @tc.name: MMIService_RemoveGestureMonitor_001 + * @tc.name: MMIService_RemoveGestureMonitor_003 * @tc.desc: Test RemoveGestureMonitor when service is not running * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_RemoveGestureMonitor_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_RemoveGestureMonitor_003, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5274,12 +5273,12 @@ HWTEST_F(MMIServerTest, MMIService_RemoveGestureMonitor_001, TestSize.Level1) } /** - * @tc.name: MMIService_UnsubscribeSwitchEvent_001 + * @tc.name: MMIService_UnsubscribeSwitchEvent_003 * @tc.desc: Test UnsubscribeSwitchEvent when service is not running * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIService_UnsubscribeSwitchEvent_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIService_UnsubscribeSwitchEvent_003, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5418,12 +5417,12 @@ HWTEST_F(MMIServerTest, MMIServerTest_SetKeyboardRepeatRate_002, TestSize.Level1 } /** - * @tc.name: MMIServerTest_GetKeyboardRepeatDelay_001 + * @tc.name: MMIServerTest_GetKeyboardRepeatDelay_002 * @tc.desc: Non-system applications calling GetKeyboardRepeatDelay should return ERROR_NOT_SYSAPI * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatDelay_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatDelay_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5434,12 +5433,12 @@ HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatDelay_001, TestSize.Level } /** - * @tc.name: MMIServerTest_GetKeyboardRepeatRate_001 + * @tc.name: MMIServerTest_GetKeyboardRepeatRate_002 * @tc.desc: Non-system applications calling GetKeyboardRepeatRate should return ERROR_NOT_SYSAPI * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatRate_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatRate_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5450,12 +5449,12 @@ HWTEST_F(MMIServerTest, MMIServerTest_GetKeyboardRepeatRate_001, TestSize.Level1 } /** - * @tc.name: MMIServerTest_SubscribeKeyEvent_001 + * @tc.name: MMIServerTest_SubscribeKeyEvent_002 * @tc.desc: Non-system applications calling SubscribeKeyEvent should return ERROR_NOT_SYSAPI * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIServerTest_SubscribeKeyEvent_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIServerTest_SubscribeKeyEvent_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; @@ -5537,12 +5536,12 @@ HWTEST_F(MMIServerTest, MMIServerTest_RemovePreInputHandler_003, TestSize.Level1 } /** - * @tc.name: MMIServerTest_OnSupportKeys_001 + * @tc.name: MMIServerTest_OnSupportKeys_002 * @tc.desc: Invalid keys.size(), should return RET_ERR * @tc.type: FUNC * @tc.require: */ -HWTEST_F(MMIServerTest, MMIServerTest_OnSupportKeys_001, TestSize.Level1) +HWTEST_F(MMIServerTest, MMIServerTest_OnSupportKeys_002, TestSize.Level1) { CALL_TEST_DEBUG; MMIService mmiService; -- Gitee From cfb8a9622a3e1e0c42ebe33c30cf224637188bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98w50052426=E2=80=99?= Date: Wed, 6 Aug 2025 15:28:51 +0800 Subject: [PATCH 3/3] description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ‘w50052426’ --- service/module_loader/test/mmi_service_test.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/service/module_loader/test/mmi_service_test.cpp b/service/module_loader/test/mmi_service_test.cpp index dc760e0905..2ac812b490 100644 --- a/service/module_loader/test/mmi_service_test.cpp +++ b/service/module_loader/test/mmi_service_test.cpp @@ -5368,22 +5368,6 @@ HWTEST_F(MMIServerTest, MMIServerTest_GetCursorSurfaceId_002, TestSize.Level1) EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); } -/** - * @tc.name: MMIServerTest_SetPointerColor_003 - * @tc.desc: Non-system applications calling SetPointerColor should return ERROR_NOT_SYSAPI - * @tc.type: FUNC - * @tc.require: - */ -HWTEST_F(MMIServerTest, MMIServerTest_SetPointerColor_003, TestSize.Level1) -{ - CALL_TEST_DEBUG; - MMIService mmiService; - mmiService.state_ = ServiceRunningState::STATE_RUNNING; - int32_t color = 0xFFFFFFFF; - int32_t ret = mmiService.SetPointerColor(color); - EXPECT_TRUE(ret == ERROR_NOT_SYSAPI || ret == ETASKS_POST_SYNCTASK_FAIL); -} - /** * @tc.name: MMIServerTest_GetPointerColor_002 * @tc.desc: Non-system applications calling GetPointerColor should return ERROR_NOT_SYSAPI -- Gitee