81475c7a52aee0b23218be30794699dc6f1a02cc
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TouchEventCombiner.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <iostream>
19
20 #include <stdlib.h>
21 #include <dali/public-api/dali-core.h>
22 #include <dali/integration-api/events/touch-event-combiner.h>
23 #include <dali/integration-api/events/touch-event-integ.h>
24 #include <dali/integration-api/events/hover-event-integ.h>
25 #include <dali-test-suite-utils.h>
26
27 using namespace Dali;
28 using namespace Dali::Integration;
29
30 namespace
31 {
32 Point GeneratePoint( int deviceId, PointState::Type state, float x, float y )
33 {
34   Point point;
35   point.SetDeviceId( deviceId );
36   point.SetState( state );
37   point.SetScreenPosition( Vector2( x, y ) );
38   return point;
39 }
40 }
41
42 void utc_dali_touch_event_combiner_startup(void)
43 {
44   test_return_value = TET_UNDEF;
45 }
46
47 void utc_dali_touch_event_combiner_cleanup(void)
48 {
49   test_return_value = TET_PASS;
50 }
51
52
53 int UtcDaliTouchEventCombinerConstructors(void)
54 {
55   TouchEventCombiner combiner1;
56   DALI_TEST_EQUALS( combiner1.GetMinimumMotionTimeThreshold(), static_cast<long unsigned>(1), TEST_LOCATION );
57   DALI_TEST_EQUALS( combiner1.GetMinimumMotionDistanceThreshold(), Vector2( 1.0f, 1.0f ), TEST_LOCATION );
58
59   TouchEventCombiner combiner2( 10, 20.0f, 31.0f );
60   DALI_TEST_EQUALS( combiner2.GetMinimumMotionTimeThreshold(), static_cast<long unsigned>(10), TEST_LOCATION );
61   DALI_TEST_EQUALS( combiner2.GetMinimumMotionDistanceThreshold(), Vector2( 20.0f, 31.0f ), TEST_LOCATION );
62
63   TouchEventCombiner combiner3( 10, Vector2( 20.0f, 31.0f ) );
64   DALI_TEST_EQUALS( combiner3.GetMinimumMotionTimeThreshold(), static_cast<long unsigned>(10), TEST_LOCATION );
65   DALI_TEST_EQUALS( combiner3.GetMinimumMotionDistanceThreshold(), Vector2( 20.0f, 31.0f ), TEST_LOCATION );
66
67   // Boundary Checks
68
69   TouchEventCombiner combiner4( 10, 0.0f, 0.0f );
70   DALI_TEST_EQUALS( combiner4.GetMinimumMotionDistanceThreshold(), Vector2( 0.0f, 0.0f ), TEST_LOCATION );
71
72   TouchEventCombiner combiner5( 10, Vector2( 0.0f, 0.0f ) );
73   DALI_TEST_EQUALS( combiner5.GetMinimumMotionDistanceThreshold(), Vector2( 0.0f, 0.0f ), TEST_LOCATION );
74   END_TEST;
75 }
76
77 int UtcDaliTouchEventCombinerConstructorsNegative(void)
78 {
79   try
80   {
81     TouchEventCombiner combiner( 10, -20.0f, 31.0f );
82     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
83     tet_result( TET_FAIL );
84   }
85   catch ( Dali::DaliException& e )
86   {
87     tet_result( TET_PASS );
88   }
89
90   try
91   {
92     TouchEventCombiner combiner( 10, 20.0f, -31.0f );
93     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
94     tet_result( TET_FAIL );
95   }
96   catch ( Dali::DaliException& e )
97   {
98     tet_result( TET_PASS );
99   }
100
101   try
102   {
103     TouchEventCombiner combiner( 10, Vector2( -20.0f, 31.0f ) );
104     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
105     tet_result( TET_FAIL );
106   }
107   catch ( Dali::DaliException& e )
108   {
109     tet_result( TET_PASS );
110   }
111
112   try
113   {
114     TouchEventCombiner combiner( 10, Vector2( 20.0f, -31.0f ) );
115     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
116     tet_result( TET_FAIL );
117   }
118   catch ( Dali::DaliException& e )
119   {
120     tet_result( TET_PASS );
121   }
122   END_TEST;
123 }
124
125 int UtcDaliTouchEventCombinerSettersAndGetters(void)
126 {
127   TouchEventCombiner combiner;
128   unsigned long time( 10u );
129   Vector2 distance( 40.0f, 30.0f );
130
131   DALI_TEST_CHECK( combiner.GetMinimumMotionTimeThreshold() != time );
132   DALI_TEST_CHECK( combiner.GetMinimumMotionDistanceThreshold() != distance );
133
134   combiner.SetMinimumMotionTimeThreshold( time );
135   DALI_TEST_EQUALS( combiner.GetMinimumMotionTimeThreshold(), time, TEST_LOCATION );
136
137   combiner.SetMinimumMotionDistanceThreshold( distance.x );
138   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), Vector2( distance.x, distance.x ), TEST_LOCATION );
139
140   distance.x = 20.0f;
141   distance.y = 50.0f;
142   combiner.SetMinimumMotionDistanceThreshold( distance.x, distance.y );
143   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), distance, TEST_LOCATION );
144
145   distance.x = 100.0f;
146   distance.y = 20.0f;
147   combiner.SetMinimumMotionDistanceThreshold( distance );
148   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), distance, TEST_LOCATION );
149
150   // Boundary Checks
151
152   combiner.SetMinimumMotionDistanceThreshold( 0.0f );
153   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), Vector2::ZERO, TEST_LOCATION );
154
155   combiner.SetMinimumMotionDistanceThreshold( 0.0f, 0.0f );
156   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), Vector2::ZERO, TEST_LOCATION );
157
158   combiner.SetMinimumMotionDistanceThreshold( Vector2::ZERO );
159   DALI_TEST_EQUALS( combiner.GetMinimumMotionDistanceThreshold(), Vector2::ZERO, TEST_LOCATION );
160   END_TEST;
161 }
162
163 int UtcDaliTouchEventCombinerSettersNegative(void)
164 {
165   TouchEventCombiner combiner;
166
167   try
168   {
169     combiner.SetMinimumMotionDistanceThreshold( -100.0f );
170     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
171     tet_result( TET_FAIL );
172   }
173   catch ( Dali::DaliException& e )
174   {
175     tet_result( TET_PASS );
176   }
177
178   try
179   {
180     combiner.SetMinimumMotionDistanceThreshold( -100.0f, 20.0f );
181     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
182     tet_result( TET_FAIL );
183   }
184   catch ( Dali::DaliException& e )
185   {
186     tet_result( TET_PASS );
187   }
188
189   try
190   {
191     combiner.SetMinimumMotionDistanceThreshold( 100.0f, -20.0f );
192     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
193     tet_result( TET_FAIL );
194   }
195   catch ( Dali::DaliException& e )
196   {
197     tet_result( TET_PASS );
198   }
199
200   try
201   {
202     combiner.SetMinimumMotionDistanceThreshold( Vector2( -100.0f, 20.0f ) );
203     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
204     tet_result( TET_FAIL );
205   }
206   catch ( Dali::DaliException& e )
207   {
208     tet_result( TET_PASS );
209   }
210
211   try
212   {
213     combiner.SetMinimumMotionDistanceThreshold( Vector2( 100.0f, -20.0f ) );
214     tet_printf( "%s: Should have asserted\n", TEST_LOCATION );
215     tet_result( TET_FAIL );
216   }
217   catch ( Dali::DaliException& e )
218   {
219     tet_result( TET_PASS );
220   }
221   END_TEST;
222 }
223
224 int UtcDaliTouchEventCombinerSingleTouchNormal(void)
225 {
226   TouchEventCombiner combiner;
227   unsigned long time( 0u );
228
229   // Down event
230   {
231     Integration::TouchEvent touchEvent;
232     Integration::HoverEvent hoverEvent;
233     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
234
235     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
236     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
237     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
238     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
239     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
240   }
241
242   time++;
243
244   // Motion in X direction
245   {
246     Integration::TouchEvent touchEvent;
247     Integration::HoverEvent hoverEvent;
248     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 100.0f );
249
250     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
251     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
252     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
253     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
254     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
255   }
256
257   time++;
258
259   // Motion in Y direction
260   {
261     Integration::TouchEvent touchEvent;
262     Integration::HoverEvent hoverEvent;
263     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 101.0f );
264
265     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
266     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
267     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
268     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
269     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
270   }
271
272   // Motion event, but same time
273   {
274     Integration::TouchEvent touchEvent;
275     Integration::HoverEvent hoverEvent;
276     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
277
278     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
279   }
280
281   time++;
282
283   // Motion event, both X and Y movement
284   {
285     Integration::TouchEvent touchEvent;
286     Integration::HoverEvent hoverEvent;
287     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
288
289     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
290     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
291     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
292     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
293     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
294   }
295
296   time++;
297
298   // Motion event, no movement
299   {
300     Integration::TouchEvent touchEvent;
301     Integration::HoverEvent hoverEvent;
302     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
303
304     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
305   }
306
307   // Up event, no time diff, no movement
308   {
309     Integration::TouchEvent touchEvent;
310     Integration::HoverEvent hoverEvent;
311     Integration::Point point = GeneratePoint( 1, PointState::UP, 102.0f, 102.0f );
312
313     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
314     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
315     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
316     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
317     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
318   }
319   END_TEST;
320 }
321
322 int UtcDaliTouchEventCombinerSingleTouchMotionWithoutDown(void)
323 {
324   TouchEventCombiner combiner;
325   unsigned long time( 0u );
326
327   // Motion event
328   {
329     Integration::TouchEvent touchEvent;
330     Integration::HoverEvent hoverEvent;
331     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 100.0f, 100.0f );
332
333     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
334     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
335     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
336     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
337     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
338   }
339
340   time++;
341
342   // Motion event
343   {
344     Integration::TouchEvent touchEvent;
345     Integration::HoverEvent hoverEvent;
346     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
347
348     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
349     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
350     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
351     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
352     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
353   }
354   END_TEST;
355 }
356
357 int UtcDaliTouchEventCombinerSingleTouchMotionFollowedByDown(void)
358 {
359   TouchEventCombiner combiner;
360   unsigned long time( 0u );
361
362   // Motion event
363   {
364     Integration::TouchEvent touchEvent;
365     Integration::HoverEvent hoverEvent;
366     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 100.0f, 100.0f );
367
368     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
369     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
370     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
371     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
372     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
373   }
374
375   time++;
376
377   // Motion event
378   {
379     Integration::TouchEvent touchEvent;
380     Integration::HoverEvent hoverEvent;
381     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
382
383     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
384     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
385     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
386     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
387     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
388   }
389
390   time++;
391
392   // Motion event
393   {
394     Integration::TouchEvent touchEvent;
395     Integration::HoverEvent hoverEvent;
396     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 103.0f, 103.0f );
397
398     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
399     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
400     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
401     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
402     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
403   }
404
405   time++;
406
407   // Down event
408   {
409     Integration::TouchEvent touchEvent;
410     Integration::HoverEvent hoverEvent;
411     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 103.0f, 103.0f );
412
413     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
414     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
415     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
416     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
417     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
418     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
419     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
420     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::FINISHED, TEST_LOCATION );
421     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
422   }
423   END_TEST;
424 }
425
426 int UtcDaliTouchEventCombinerSingleTouchTwoDowns(void)
427 {
428   TouchEventCombiner combiner;
429   unsigned long time( 0u );
430
431   // Down event
432   {
433     Integration::TouchEvent touchEvent;
434     Integration::HoverEvent hoverEvent;
435     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
436
437     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
438     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
439     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
440     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
441     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
442   }
443
444   time++;
445
446   // Another down with the same ID
447   {
448     Integration::TouchEvent touchEvent;
449     Integration::HoverEvent hoverEvent;
450     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
451
452     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
453   }
454   END_TEST;
455 }
456
457 int UtcDaliTouchEventCombinerSingleTouchUpWithoutDown(void)
458 {
459   TouchEventCombiner combiner;
460   unsigned long time( 0u );
461
462   // Up event
463   {
464     Integration::TouchEvent touchEvent;
465     Integration::HoverEvent hoverEvent;
466     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
467
468     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
469   }
470
471   time++;
472
473   // Up event
474   {
475     Integration::TouchEvent touchEvent;
476     Integration::HoverEvent hoverEvent;
477     Integration::Point point = GeneratePoint( 1, PointState::UP, 102.0f, 102.0f );
478
479     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
480   }
481   END_TEST;
482 }
483
484 int UtcDaliTouchEventCombinerSingleTouchTwoUps(void)
485 {
486   TouchEventCombiner combiner;
487   unsigned long time( 0u );
488
489   // Down event
490   {
491     Integration::TouchEvent touchEvent;
492     Integration::HoverEvent hoverEvent;
493     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
494
495     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
496     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
497     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
498     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
499     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
500   }
501
502   time++;
503
504   // Up event
505   {
506     Integration::TouchEvent touchEvent;
507     Integration::HoverEvent hoverEvent;
508     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
509
510     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
511     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
512     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
513     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
514     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
515   }
516
517   time++;
518
519   // Another up event
520   {
521     Integration::TouchEvent touchEvent;
522     Integration::HoverEvent hoverEvent;
523     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
524
525     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
526   }
527   END_TEST;
528 }
529
530 int UtcDaliTouchEventCombinerSingleTouchUpWithDifferentId(void)
531 {
532   TouchEventCombiner combiner;
533   unsigned long time( 0u );
534
535   // Down event
536   {
537     Integration::TouchEvent touchEvent;
538     Integration::HoverEvent hoverEvent;
539     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
540
541     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
542     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
543     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
544     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
545     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
546   }
547
548   time++;
549
550   // Up event with different ID
551   {
552     Integration::TouchEvent touchEvent;
553     Integration::HoverEvent hoverEvent;
554     Integration::Point point = GeneratePoint( 2, PointState::UP, 100.0f, 100.0f );
555
556     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
557   }
558
559   time++;
560
561   // Up event
562   {
563     Integration::TouchEvent touchEvent;
564     Integration::HoverEvent hoverEvent;
565     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
566
567     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
568     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
569     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
570     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
571     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
572   }
573   END_TEST;
574 }
575
576 int UtcDaliTouchEventCombinerSingleTouchMotionWithDifferentId(void)
577 {
578   TouchEventCombiner combiner;
579   unsigned long time( 0u );
580
581   // Down event
582   {
583     Integration::TouchEvent touchEvent;
584     Integration::HoverEvent hoverEvent;
585     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
586
587     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
588     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
589     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
590     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
591     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
592   }
593
594   time++;
595
596   // Motion event with different ID
597   {
598     Integration::TouchEvent touchEvent;
599     Integration::HoverEvent hoverEvent;
600     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 100.0f, 100.0f );
601
602     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
603     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
604     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
605     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
606     DALI_TEST_EQUALS( hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
607   }
608
609   time++;
610
611   // Motion event
612   {
613     Integration::TouchEvent touchEvent;
614     Integration::HoverEvent hoverEvent;
615     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
616
617     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
618     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
619     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
620     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
621     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
622   }
623   END_TEST;
624 }
625
626 int UtcDaliTouchEventCombinerMultiTouchNormal(void)
627 {
628   TouchEventCombiner combiner;
629   unsigned long time( 0u );
630
631   // 1st point down
632   {
633     Integration::TouchEvent touchEvent;
634     Integration::HoverEvent hoverEvent;
635     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
636
637     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
638     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
639     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
640     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
641     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
642   }
643
644   time++;
645
646   // 2nd point down
647   {
648     Integration::TouchEvent touchEvent;
649     Integration::HoverEvent hoverEvent;
650     Integration::Point point = GeneratePoint( 2, PointState::DOWN, 200.0f, 200.0f );
651
652     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
653     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
654     DALI_TEST_EQUALS( touchEvent.points[1].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
655     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), PointState::STATIONARY, TEST_LOCATION );
656     DALI_TEST_EQUALS( touchEvent.points[1].GetState(), point.GetState(), TEST_LOCATION );
657     DALI_TEST_EQUALS( touchEvent.points[1].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
658   }
659
660   time++;
661
662   // 1st point motion
663   {
664     Integration::TouchEvent touchEvent;
665     Integration::HoverEvent hoverEvent;
666     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 100.0f );
667
668     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
669     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
670     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
671     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
672     DALI_TEST_EQUALS( touchEvent.points[1].GetState(), PointState::STATIONARY, TEST_LOCATION );
673     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
674   }
675
676   // 2nd point motion, no time diff
677   {
678     Integration::TouchEvent touchEvent;
679     Integration::HoverEvent hoverEvent;
680     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 200.0f, 200.0f );
681
682     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
683   }
684
685   time++;
686
687   // 2nd point motion
688   {
689     Integration::TouchEvent touchEvent;
690     Integration::HoverEvent hoverEvent;
691     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 201.0f, 201.0f );
692
693     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
694     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
695     DALI_TEST_EQUALS( touchEvent.points[1].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
696     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), PointState::STATIONARY, TEST_LOCATION );
697     DALI_TEST_EQUALS( touchEvent.points[1].GetState(), point.GetState(), TEST_LOCATION );
698     DALI_TEST_EQUALS( touchEvent.points[1].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
699   }
700
701   time++;
702
703   // 1st point up
704   {
705     Integration::TouchEvent touchEvent;
706     Integration::HoverEvent hoverEvent;
707     Integration::Point point = GeneratePoint( 1, PointState::UP, 101.0f, 100.0f );
708
709     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
710     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
711     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
712     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
713     DALI_TEST_EQUALS( touchEvent.points[1].GetState(), PointState::STATIONARY, TEST_LOCATION );
714     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
715   }
716
717   time++;
718
719   // 2nd point motion
720   {
721     Integration::TouchEvent touchEvent;
722     Integration::HoverEvent hoverEvent;
723     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 202.0f, 202.0f );
724
725     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
726     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
727     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
728     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
729     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
730   }
731
732   time++;
733
734   // 2nd point up
735   {
736     Integration::TouchEvent touchEvent;
737     Integration::HoverEvent hoverEvent;
738     Integration::Point point = GeneratePoint( 2, PointState::UP, 202.0f, 202.0f );
739
740     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
741     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
742     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
743     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
744     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
745   }
746   END_TEST;
747 }
748
749 int UtcDaliTouchEventCombinerSeveralPoints(void)
750 {
751   TouchEventCombiner combiner;
752   unsigned long time( 0u );
753   unsigned int const maximum( 200u );
754
755   // Several downs
756   for ( unsigned int pointCount = 1u; pointCount < maximum; ++pointCount )
757   {
758     Integration::TouchEvent touchEvent;
759     Integration::HoverEvent hoverEvent;
760     Integration::Point point = GeneratePoint( pointCount, PointState::DOWN, 100.0f, 100.0f );
761
762     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
763     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
764   }
765
766   // Several Ups
767   for ( unsigned int pointCount = maximum - 1; pointCount > 0; --pointCount )
768   {
769     Integration::TouchEvent touchEvent;
770     Integration::HoverEvent hoverEvent;
771     Integration::Point point = GeneratePoint( pointCount, PointState::UP, 100.0f, 100.0f );
772
773     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
774     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
775   }
776   END_TEST;
777 }
778
779 int UtcDaliTouchEventCombinerReset(void)
780 {
781   TouchEventCombiner combiner;
782   unsigned long time( 0u );
783
784   // Down event
785   {
786     Integration::TouchEvent touchEvent;
787     Integration::HoverEvent hoverEvent;
788     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
789
790     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
791     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
792     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
793     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
794     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
795   }
796
797   time++;
798
799   // Reset combiner, no more events should be sent to core.
800   combiner.Reset();
801
802   // Up event
803   {
804     Integration::TouchEvent touchEvent;
805     Integration::HoverEvent hoverEvent;
806     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
807
808     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
809   }
810   END_TEST;
811 }
812
813 int UtcDaliTouchEventCombinerSingleTouchInterrupted(void)
814 {
815   TouchEventCombiner combiner;
816   unsigned long time( 0u );
817
818   // Down event
819   {
820     Integration::TouchEvent touchEvent;
821     Integration::HoverEvent hoverEvent;
822     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
823
824     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
825     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
826     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
827     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
828     DALI_TEST_EQUALS( touchEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION );
829   }
830
831   time++;
832
833   // Interrupted event
834   {
835     Integration::TouchEvent touchEvent;
836     Integration::HoverEvent hoverEvent;
837     Integration::Point point = GeneratePoint( 1, PointState::INTERRUPTED, 100.0f, 100.0f );
838
839     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
840     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
841     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
842     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
843     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
844   }
845
846   // Send up, should not be able to send as combiner has been reset.
847   // Up event
848   {
849     Integration::TouchEvent touchEvent;
850     Integration::HoverEvent hoverEvent;
851     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
852
853     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
854   }
855   END_TEST;
856 }
857
858 int UtcDaliTouchEventCombinerMultiTouchInterrupted(void)
859 {
860   TouchEventCombiner combiner;
861   unsigned long time( 0u );
862   unsigned int const maximum( 200u );
863
864   // Several downs
865   for ( unsigned int pointCount = 1u; pointCount < maximum; ++pointCount )
866   {
867     Integration::TouchEvent touchEvent;
868     Integration::HoverEvent hoverEvent;
869     Integration::Point point = GeneratePoint( pointCount, PointState::DOWN, 100.0f, 100.0f );
870
871     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
872     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
873   }
874
875   // Interrupted event
876   {
877     Integration::TouchEvent touchEvent;
878     Integration::HoverEvent hoverEvent;
879     Integration::Point point = GeneratePoint( 1, PointState::INTERRUPTED, 100.0f, 100.0f );
880
881     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
882     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
883     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
884     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
885     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
886   }
887
888   // Send up, should not be able to send as combiner has been reset.
889   // Up event
890   {
891     Integration::TouchEvent touchEvent;
892     Integration::HoverEvent hoverEvent;
893     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
894
895     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
896   }
897   END_TEST;
898 }
899
900 int UtcDaliTouchEventCombinerInvalidState(void)
901 {
902   TouchEventCombiner combiner;
903   unsigned long time( 0u );
904
905   // Stationary event
906   {
907     Integration::TouchEvent touchEvent;
908     Integration::HoverEvent hoverEvent;
909     Integration::Point point = GeneratePoint( 1, PointState::STATIONARY, 100.0f, 100.0f );
910
911     DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
912   }
913   END_TEST;
914 }