1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include <gtest/gtest.h> 17 18 #include "mmi_log.h" 19 #include "mouse_event_normalize.h" 20 21 #undef MMI_LOG_TAG 22 #define MMI_LOG_TAG "MouseEventNormalizeEXTest" 23 24 namespace OHOS { 25 namespace MMI { 26 namespace { 27 using namespace testing::ext; 28 } 29 class MouseEventNormalizeEXTest : public testing::Test { 30 public: SetUpTestCase(void)31 static void SetUpTestCase(void) {} TearDownTestCase(void)32 static void TearDownTestCase(void) {} 33 }; 34 35 /** 36 * @tc.name: MouseEventNormalizeEXTest_GetPointerLocation_001 37 * @tc.desc: Test GetPointerLocation 38 * @tc.type: FUNC 39 * @tc.require: 40 */ 41 HWTEST_F(MouseEventNormalizeEXTest, MouseEventNormalizeEXTest_GetPointerLocation_001, TestSize.Level1) 42 { 43 int32_t displayId = 0; 44 double displayX = 0.0; 45 double displayY = 0.0; 46 EXPECT_EQ(MouseEventHdr->GetPointerLocation(displayId, displayX, displayY), RET_OK); 47 EXPECT_EQ(displayId, -1); 48 EXPECT_EQ(displayX, 0); 49 EXPECT_EQ(displayY, 0); 50 } 51 } 52 }