(HitTest) Ensure we do not create Actor handles when using the hit-test callback
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-EventProcessing.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <dali/dali.h>
21 #include <dali/integration-api/events/event.h>
22 #include <dali/integration-api/events/gesture-event.h>
23 #include <dali-test-suite-utils.h>
24
25 using namespace Dali;
26
27 void utc_dali_event_processing_startup(void)
28 {
29   test_return_value = TET_UNDEF;
30 }
31
32 void utc_dali_event_processing_cleanup(void)
33 {
34   test_return_value = TET_PASS;
35 }
36
37 namespace
38 {
39
40 struct InvalidEvent : public Integration::Event
41 {
42   InvalidEvent() : Event( Event::Type(-1000) ) {}
43   ~InvalidEvent() {}
44 };
45
46 struct InvalidGesture : public Integration::GestureEvent
47 {
48   InvalidGesture() : GestureEvent( Gesture::Type(-1000), Gesture::Clear ) {}
49   ~InvalidGesture() {}
50 };
51
52 } // anon namespace
53
54 int UtcDaliInvalidEvent(void)
55 {
56   TestApplication application;
57
58   try
59   {
60     InvalidEvent event;
61     application.ProcessEvent( event );
62     tet_result( TET_FAIL );
63   }
64   catch ( Dali::DaliException& e )
65   {
66     DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
67   }
68   END_TEST;
69 }
70
71 int UtcDaliInvalidGesture(void)
72 {
73   TestApplication application;
74
75   try
76   {
77     InvalidGesture event;
78     application.ProcessEvent( event );
79     tet_result( TET_FAIL );
80   }
81   catch ( Dali::DaliException& e )
82   {
83     DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
84   }
85   END_TEST;
86 }