2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
22 #include <dali/public-api/dali-core.h>
23 #include <dali-toolkit/dali-toolkit.h>
25 #include <dali-toolkit-test-suite-utils.h>
28 using namespace Dali::Toolkit;
30 static void Startup();
31 static void Cleanup();
34 void (*tet_startup)() = Startup;
35 void (*tet_cleanup)() = Cleanup;
38 static void UtcDaliSoftButtonEffectUninitialized();
39 static void UtcDaliSoftButtonEffectNew();
40 static void UtcDaliSoftButtonEffectPropertyNames();
43 POSITIVE_TC_IDX = 0x01,
47 // Add test functionality for all APIs in the class (Positive and Negative)
49 struct tet_testlist tet_testlist[] = {
50 { UtcDaliSoftButtonEffectUninitialized, NEGATIVE_TC_IDX },
51 { UtcDaliSoftButtonEffectNew, POSITIVE_TC_IDX },
52 { UtcDaliSoftButtonEffectPropertyNames, POSITIVE_TC_IDX },
57 // Called only once before first test is run.
62 // Called only once after last test is run
67 // Negative test case for a method
68 static void UtcDaliSoftButtonEffectUninitialized()
70 ToolkitTestApplication application;
71 tet_infoline("UtcDaliSoftButtonEffectUninitialized");
73 Toolkit::SoftButtonEffect effect;
75 // New() must be called to create a SoftButtonEffect or it wont be valid.
77 DALI_TEST_CHECK(!effect);
80 // Positive test case for a method
81 static void UtcDaliSoftButtonEffectNew()
83 ToolkitTestApplication application;
84 tet_infoline("UtcDaliGaussianBlurViewNew");
86 Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
87 DALI_TEST_CHECK( effect );
90 // Positive test case for a method
91 static void UtcDaliSoftButtonEffectPropertyNames()
93 ToolkitTestApplication application;
94 tet_infoline("UtcDaliSoftButtonEffectPropertyNames");
96 Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
97 DALI_TEST_CHECK( effect );
99 // Check the names, this names are used in the shader code,
100 // if they change in the shader code, then it has to be updated here.
101 DALI_TEST_EQUALS( effect.GetLightingIndentationAmountPropertyName(), "uLightingIndentationAmount", TEST_LOCATION );
102 DALI_TEST_EQUALS( effect.GetTextureDistortionAmountPropertyName(), "uTextureDistortAmount", TEST_LOCATION );
103 DALI_TEST_EQUALS( effect.GetAmbientLightAmountPropertyName(), "uAmbientLight", TEST_LOCATION );
104 DALI_TEST_EQUALS( effect.GetDiffuseLightPropertyName(), "uDiffuseLight", TEST_LOCATION );
105 DALI_TEST_EQUALS( effect.GetLightingMultiplierPropertyName(), "uLightMultiplier", TEST_LOCATION );
106 DALI_TEST_EQUALS( effect.GetInsideShapeSizeScalePropertyName(), "uInsideCircleSizeScale", TEST_LOCATION );
107 DALI_TEST_EQUALS( effect.GetOutsideShapeDepthPropertyName(), "uOutsideCircleDepth", TEST_LOCATION );
108 DALI_TEST_EQUALS( effect.GetEffectPixelAreaPropertyName(), "uEffectRegion", TEST_LOCATION );
109 DALI_TEST_EQUALS( effect.GetRectangleSizeScalePropertyName(), "uRectangleSizeScale", TEST_LOCATION );