| 1 |
// SPDX-FileCopyrightText: 2019 - 2026 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#include "test_touchgestureoperation.h" |
| 6 |
|
| 7 |
test_touchgestureoperation::test_touchgestureoperation() |
| 8 |
{ |
| 9 |
mTouchGestureOperation = new touchGestureOperation(); |
| 10 |
} |
| 11 |
|
| 12 |
test_touchgestureoperation::~test_touchgestureoperation() |
| 13 |
{ |
| 14 |
delete mTouchGestureOperation; |
| 15 |
mTouchGestureOperation = nullptr; |
| 16 |
} |
| 17 |
|
| 18 |
//void touchGestureOperation::setUpdate(bool b) |
| 19 |
TEST_F(test_touchgestureoperation, setUpdate) |
| 20 |
{ |
| 21 |
mTouchGestureOperation->setUpdate(true); |
| 22 |
} |
| 23 |
|
| 24 |
//bool touchGestureOperation::isUpdate() const |
| 25 |
TEST_F(test_touchgestureoperation, isUpdate) |
| 26 |
{ |
| 27 |
mTouchGestureOperation->setUpdate(false); |
| 28 |
bool res = mTouchGestureOperation->isUpdate(); |
| 29 |
EXPECT_FALSE(res); |
| 30 |
mTouchGestureOperation->setUpdate(true); |
| 31 |
res = mTouchGestureOperation->isUpdate(); |
| 32 |
EXPECT_TRUE(res); |
| 33 |
} |
| 34 |
|
| 35 |
//touchGestureOperation::TouchState touchGestureOperation::getTouchState() const |
| 36 |
TEST_F(test_touchgestureoperation, getTouchState) |
| 37 |
{ |
| 38 |
mTouchGestureOperation->getTouchState(); |
| 39 |
} |
| 40 |
|
| 41 |
//touchGestureOperation::TouchMovingDirection touchGestureOperation::getMovingDir() const |
| 42 |
TEST_F(test_touchgestureoperation, getMovingDir) |
| 43 |
{ |
| 44 |
mTouchGestureOperation->getMovingDir(); |
| 45 |
} |
| 46 |
|
| 47 |
//touchGestureOperation::TouchMovingDirection touchGestureOperation::getTouchMovingDir(QPointF &startPoint, QPointF &stopPoint, qreal &movingLine) |
| 48 |
TEST_F(test_touchgestureoperation, getTouchMovingDir) |
| 49 |
{ |
| 50 |
QPointF point1; |
| 51 |
QPointF point2; |
| 52 |
qreal num = 2; |
| 53 |
mTouchGestureOperation->getTouchMovingDir(point1, point2, num); |
| 54 |
} |
| 55 |
|
| 56 |
//void touchGestureOperation::calculateAzimuthAngle(QPointF &startPoint, QPointF &stopPoint) |
| 57 |
TEST_F(test_touchgestureoperation, calculateAzimuthAngle) |
| 58 |
{ |
| 59 |
QPointF point1; |
| 60 |
QPointF point2; |
| 61 |
mTouchGestureOperation->calculateAzimuthAngle(point1, point2); |
| 62 |
} |