38c8d5031f9c9414c5622aee6852ef04e1659268
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-unmanaged / utc-Dali-SoftButtonEffect.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 #include <stdlib.h>
19 #include <dali-toolkit-test-suite-utils.h>
20 #include <dali-toolkit/dali-toolkit.h>
21
22 using namespace Dali;
23 using namespace Dali::Toolkit;
24
25 void soft_button_effect_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void soft_button_effect_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35 // Negative test case for a method
36 int UtcDaliSoftButtonEffectUninitialized(void)
37 {
38   ToolkitTestApplication application;
39   tet_infoline("UtcDaliSoftButtonEffectUninitialized");
40
41   Toolkit::SoftButtonEffect effect;
42
43   // New() must be called to create a SoftButtonEffect or it wont be valid.
44
45   DALI_TEST_CHECK(!effect);
46   END_TEST;
47 }
48
49 // Positive test case for a method
50 int UtcDaliSoftButtonEffectNew(void)
51 {
52   ToolkitTestApplication application;
53   tet_infoline("UtcDaliGaussianBlurViewNew");
54
55   Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
56   DALI_TEST_CHECK( effect );
57   END_TEST;
58 }
59
60 // Positive test case for a method
61 int UtcDaliSoftButtonEffectPropertyNames(void)
62 {
63   ToolkitTestApplication application;
64   tet_infoline("UtcDaliSoftButtonEffectPropertyNames");
65
66   Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
67   DALI_TEST_CHECK( effect );
68
69   // Check the names, this names are used in the shader code,
70   // if they change in the shader code, then it has to be updated here.
71   DALI_TEST_EQUALS( effect.GetLightingIndentationAmountPropertyName(), "uLightingIndentationAmount", TEST_LOCATION );
72   DALI_TEST_EQUALS( effect.GetTextureDistortionAmountPropertyName(), "uTextureDistortAmount", TEST_LOCATION );
73   DALI_TEST_EQUALS( effect.GetAmbientLightAmountPropertyName(), "uAmbientLight", TEST_LOCATION );
74   DALI_TEST_EQUALS( effect.GetDiffuseLightPropertyName(), "uDiffuseLight", TEST_LOCATION );
75   DALI_TEST_EQUALS( effect.GetLightingMultiplierPropertyName(), "uLightMultiplier", TEST_LOCATION );
76   DALI_TEST_EQUALS( effect.GetInsideShapeSizeScalePropertyName(), "uInsideCircleSizeScale", TEST_LOCATION );
77   DALI_TEST_EQUALS( effect.GetOutsideShapeDepthPropertyName(), "uOutsideCircleDepth", TEST_LOCATION );
78   DALI_TEST_EQUALS( effect.GetEffectPixelAreaPropertyName(), "uEffectRegion", TEST_LOCATION );
79   DALI_TEST_EQUALS( effect.GetRectangleSizeScalePropertyName(), "uRectangleSizeScale", TEST_LOCATION );
80   END_TEST;
81 }