77#include " Settings.h"
88#include " WindowManager.h"
99#include " desktops/Desktop.h"
10+ #include " driver/MouseCoords.h"
1011#include " helpers/containerUtils.h"
1112#include " ingameWindows/IngameWindow.h"
1213#include " ingameWindows/TransmitSettingsIgwAdapter.h"
@@ -70,17 +71,11 @@ BOOST_FIXTURE_TEST_CASE(LeftClick, WMFixture)
7071{
7172 video->tickCount_ = 0 ;
7273 mock::sequence s;
73- <<<<<<< HEAD
7474 MouseCoords mc1 (5 , 2 );
7575 mc1.ldown = true ;
7676 MouseCoords mc1_u (mc1.pos );
7777 MouseCoords mc2 (10 , 7 );
7878 mc2.ldown = true ;
79- =======
80- MouseCoords mc1 (5 , 2 , true );
81- MouseCoords mc1_u (mc1.pos );
82- MouseCoords mc2 (10 , 7 , true );
83- >>>>>>> 9c0b20071 (Added tests for cfg envOverride and touch dblClick)
8479 MouseCoords mc2_u (mc2.pos );
8580 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc1).in (s).returns (true );
8681 MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (mc1_u).in (s).returns (true );
@@ -105,17 +100,11 @@ BOOST_FIXTURE_TEST_CASE(DblClick, WMFixture)
105100{
106101 video->tickCount_ = 0 ;
107102 mock::sequence s;
108- <<<<<<< HEAD
109103 MouseCoords mc1 (5 , 2 );
110104 mc1.ldown = true ;
111105 MouseCoords mc1_u (mc1.pos );
112106 MouseCoords mc2 (6 , 1 );
113107 mc2.ldown = true ;
114- =======
115- MouseCoords mc1 (5 , 2 , true );
116- MouseCoords mc1_u (mc1.pos );
117- MouseCoords mc2 (6 , 1 , true );
118- >>>>>>> 9c0b20071 (Added tests for cfg envOverride and touch dblClick)
119108 MouseCoords mc2_u (mc2.pos );
120109 // Click with time > DOUBLE_CLICK_INTERVAL is no dbl click
121110 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc1).in (s).returns (true );
@@ -127,13 +116,9 @@ BOOST_FIXTURE_TEST_CASE(DblClick, WMFixture)
127116 MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (mc2_u).in (s).returns (true );
128117 // Click on same pos with time < DOUBLE_CLICK_INTERVAL is dbl click
129118 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc2).in (s).returns (true );
130- <<<<<<< HEAD
131119 MouseCoords dbl_mc2 (mc2.pos );
132120 dbl_mc2.dbl_click = true ;
133121 MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (dbl_mc2).in (s).returns (true );
134- =======
135- MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (MouseCoords (mc2.pos , false , false , true )).in (s).returns (true );
136- >>>>>>> 9c0b20071 (Added tests for cfg envOverride and touch dblClick)
137122 // No triple click
138123 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc2).in (s).returns (true );
139124 MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (mc2_u).in (s).returns (true );
@@ -166,14 +151,23 @@ BOOST_FIXTURE_TEST_CASE(DblClickTouch, WMFixture)
166151 video->numTfinger_ = 1 ;
167152 mock::sequence s;
168153
169- MouseCoords mc1 (5 , 2 , true , false , false , 1 );
170- MouseCoords mc1_u (mc1.pos , false , false , false , 1 );
154+ MouseCoords mc1 (5 , 2 );
155+ mc1.ldown = true ;
156+ mc1.num_tfingers = 1 ;
157+ MouseCoords mc1_u (mc1.pos );
158+ mc1_u.num_tfingers = 1 ;
171159 // Test click on distance > TOUCH_MAX_DOUBLE_CLICK_DISTANCE
172- MouseCoords mc2 (mc1.pos .x + TOUCH_MAX_DOUBLE_CLICK_DISTANCE + 1 , mc1.pos .y , true , false , false , 1 );
173- MouseCoords mc2_u (mc2.pos , false , false , false , 1 );
160+ MouseCoords mc2 (mc1.pos .x + TOUCH_MAX_DOUBLE_CLICK_DISTANCE + 1 , mc1.pos .y );
161+ mc2.ldown = true ;
162+ mc2.num_tfingers = 1 ;
163+ MouseCoords mc2_u (mc2.pos );
164+ mc2_u.num_tfingers = 1 ;
174165 // Test click on distance < TOUCH_MAX_DOUBLE_CLICK_DISTANCE
175- MouseCoords mc3 (mc2.pos .x + TOUCH_MAX_DOUBLE_CLICK_DISTANCE - 1 , mc2.pos .y , true , false , false , 1 );
176- MouseCoords mc3_u (mc3.pos , false , false , false , 1 );
166+ MouseCoords mc3 (mc2.pos .x + TOUCH_MAX_DOUBLE_CLICK_DISTANCE - 1 , mc2.pos .y );
167+ mc3.ldown = true ;
168+ mc3.num_tfingers = 1 ;
169+ MouseCoords mc3_u (mc3.pos );
170+ mc3_u.num_tfingers = 1 ;
177171
178172 // Set last click position on mc1
179173 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc1).in (s).returns (true );
@@ -185,7 +179,10 @@ BOOST_FIXTURE_TEST_CASE(DblClickTouch, WMFixture)
185179
186180 // Touch position mc3 -> In range of mc -> dblclick
187181 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc3).in (s).returns (true );
188- MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (MouseCoords (mc3.pos , false , false , true , 1 )).in (s).returns (true );
182+ MouseCoords range_mc3 (mc3.pos );
183+ range_mc3.dbl_click = true ;
184+ range_mc3.num_tfingers = 1 ;
185+ MOCK_EXPECT (dsk->Msg_LeftUp ).once ().with (range_mc3).in (s).returns (true );
189186
190187 // Try to touch 3rd time -> no dblclick -> Set last click position to mc3
191188 MOCK_EXPECT (dsk->Msg_LeftDown ).once ().with (mc3).in (s).returns (true );
0 commit comments