aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2020-06-15 13:41:39 +0200
committerSamuel Mannehed <samuel@cendio.se>2020-06-15 13:43:22 +0200
commit1ed830ce5f8a2cdac92e975e6d34db3a0162b2ae (patch)
treecd0cf46d579aeffbb8f9904e9ce935ed8a14f559 /tests
parentaa11ffed9c2ff40cd6c206fd64afd5bc9ced2af9 (diff)
downloadtigervnc-1ed830ce5f8a2cdac92e975e6d34db3a0162b2ae.tar.gz
tigervnc-1ed830ce5f8a2cdac92e975e6d34db3a0162b2ae.zip
Update gesture unit test to cover angle cornercase
If the difference in angle is larger than 180 degrees we hit a corner case. This commit modifies the coordinates of an existing test to cover this.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/gesturehandler.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/gesturehandler.cxx b/tests/unit/gesturehandler.cxx
index cdac83f0..0bf2ca77 100644
--- a/tests/unit/gesturehandler.cxx
+++ b/tests/unit/gesturehandler.cxx
@@ -860,7 +860,7 @@ void testPinchFastDistinctOut()
ASSERT_EQ(test.events.size(), 0);
test.handleTouchUpdate(1, 130.0, 70.0);
- test.handleTouchUpdate(2, 20.0, 200.0);
+ test.handleTouchUpdate(2, 0.0, 200.0);
ASSERT_EQ(test.events.size(), 0);
@@ -879,7 +879,7 @@ void testPinchFastDistinctOut()
ASSERT_EQ(test.events[1].gesture, GesturePinch);
ASSERT_EQ(test.events[1].eventX, 105.0);
ASSERT_EQ(test.events[1].eventY, 100.0);
- ASSERT_EQ(test.events[1].magnitudeX, 160.0);
+ ASSERT_EQ(test.events[1].magnitudeX, 180.0);
ASSERT_EQ(test.events[1].magnitudeY, 180.0);
test.events.clear();
@@ -892,7 +892,7 @@ void testPinchFastDistinctOut()
ASSERT_EQ(test.events[0].gesture, GesturePinch);
ASSERT_EQ(test.events[0].eventX, 105.0);
ASSERT_EQ(test.events[0].eventY, 100.0);
- ASSERT_EQ(test.events[0].magnitudeX, 160.0);
+ ASSERT_EQ(test.events[0].magnitudeX, 180.0);
ASSERT_EQ(test.events[0].magnitudeY, 180.0);
printf("OK\n");