From 49ba09ff62a5773b3cad72fc462eff784dc54230 Mon Sep 17 00:00:00 2001 From: hemenghao Date: Fri, 15 Aug 2025 16:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hemenghao --- .../src/input_method_ability_test.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unittest/cpp_test/src/input_method_ability_test.cpp b/test/unittest/cpp_test/src/input_method_ability_test.cpp index 56e680853..44d245753 100644 --- a/test/unittest/cpp_test/src/input_method_ability_test.cpp +++ b/test/unittest/cpp_test/src/input_method_ability_test.cpp @@ -2232,5 +2232,25 @@ HWTEST_F(InputMethodAbilityTest, TestOnConnectSystemCmd_001, TestSize.Level0) EXPECT_EQ(multiThreadExecTotalNum_, THREAD_NUM * MAXRUNCOUNT); } +/** + * @tc.name: testSelectByRange + * @tc.desc: InputMethodAbility SelectByRange + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(InputMethodAbilityTest, testSelectByRange, TestSize.Level0) +{ + IMSA_HILOGI("InputMethodAbility SelectByRangeTest START"); + int32_t start = 1; + int32_t end = 1; + + auto ret = InputMethodAbilityInterface::GetInstance().SelectByRange(start, end); + EXPECT_EQ(ret, ErrorCode::ERROR_CLIENT_NULL_POINTER); + + start = -1; + end = -1; + ret = InputMethodAbilityInterface::GetInstance().SelectByRange(start, end); + EXPECT_EQ(ret, ErrorCode::ERROR_PARAMETER_CHECK_FAILED); +} } // namespace MiscServices } // namespace OHOS -- Gitee