Formatting automated-tests
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-Internal-PinchGestureProcessor.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 <dali-test-suite-utils.h>
19 #include <dali/internal/event/common/scene-impl.h>
20 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-event.h>
21 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-processor.h>
22 #include <dali/public-api/dali-core.h>
23 #include <stdlib.h>
24
25 #include <iostream>
26
27 using namespace Dali;
28
29 void utc_dali_internal_pinch_gesture_processor_startup(void)
30 {
31   test_return_value = TET_UNDEF;
32 }
33
34 void utc_dali_internal_pinch_gesture_processor_cleanup(void)
35 {
36   test_return_value = TET_PASS;
37 }
38
39 namespace
40 {
41 void TestAbortWithState(GestureState state)
42 {
43   TestApplication application;
44
45   Internal::PinchGestureProcessor processor;
46   Integration::Scene              scene(application.GetScene());
47   Internal::Scene&                sceneImpl = GetImplementation(scene);
48   Internal::PinchGestureEvent     event(state);
49
50   try
51   {
52     processor.Process(sceneImpl, event);
53     DALI_TEST_CHECK(false); // Should not get here as we expect an abort
54   }
55   catch(...)
56   {
57     DALI_TEST_CHECK(true); // We aborted, so the test has passed
58   }
59 }
60
61 } // namespace
62
63 int UtcDaliPinchGestureProcessorProcessClearStateN(void)
64 {
65   TestAbortWithState(GestureState::CLEAR);
66   END_TEST;
67 }
68
69 int UtcDaliPinchGestureProcessorProcessPossibleStateN(void)
70 {
71   TestAbortWithState(GestureState::POSSIBLE);
72   END_TEST;
73 }