2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #include <dali/public-api/dali-core.h>
24 #include <dali-toolkit/dali-toolkit.h>
26 #include <dali-toolkit-test-suite-utils.h>
29 using namespace Dali::Toolkit;
31 static void Startup();
32 static void Cleanup();
35 void (*tet_startup)() = Startup;
36 void (*tet_cleanup)() = Cleanup;
39 static void UtcDaliSoftButtonEffectUninitialized();
40 static void UtcDaliSoftButtonEffectNew();
41 static void UtcDaliSoftButtonEffectPropertyNames();
44 POSITIVE_TC_IDX = 0x01,
48 // Add test functionality for all APIs in the class (Positive and Negative)
50 struct tet_testlist tet_testlist[] = {
51 { UtcDaliSoftButtonEffectUninitialized, NEGATIVE_TC_IDX },
52 { UtcDaliSoftButtonEffectNew, POSITIVE_TC_IDX },
53 { UtcDaliSoftButtonEffectPropertyNames, POSITIVE_TC_IDX },
58 // Called only once before first test is run.
63 // Called only once after last test is run
68 // Negative test case for a method
69 static void UtcDaliSoftButtonEffectUninitialized()
71 ToolkitTestApplication application;
72 tet_infoline("UtcDaliSoftButtonEffectUninitialized");
74 Toolkit::SoftButtonEffect effect;
76 // New() must be called to create a SoftButtonEffect or it wont be valid.
78 DALI_TEST_CHECK(!effect);
81 // Positive test case for a method
82 static void UtcDaliSoftButtonEffectNew()
84 ToolkitTestApplication application;
85 tet_infoline("UtcDaliGaussianBlurViewNew");
87 Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
88 DALI_TEST_CHECK( effect );
91 // Positive test case for a method
92 static void UtcDaliSoftButtonEffectPropertyNames()
94 ToolkitTestApplication application;
95 tet_infoline("UtcDaliSoftButtonEffectPropertyNames");
97 Toolkit::SoftButtonEffect effect = Toolkit::SoftButtonEffect::New(Toolkit::SoftButtonEffect::ELLIPTICAL);
98 DALI_TEST_CHECK( effect );
100 // Check the names, this names are used in the shader code,
101 // if they change in the shader code, then it has to be updated here.
102 DALI_TEST_EQUALS( effect.GetLightingIndentationAmountPropertyName(), "uLightingIndentationAmount", TEST_LOCATION );
103 DALI_TEST_EQUALS( effect.GetTextureDistortionAmountPropertyName(), "uTextureDistortAmount", TEST_LOCATION );
104 DALI_TEST_EQUALS( effect.GetAmbientLightAmountPropertyName(), "uAmbientLight", TEST_LOCATION );
105 DALI_TEST_EQUALS( effect.GetDiffuseLightPropertyName(), "uDiffuseLight", TEST_LOCATION );
106 DALI_TEST_EQUALS( effect.GetLightingMultiplierPropertyName(), "uLightMultiplier", TEST_LOCATION );
107 DALI_TEST_EQUALS( effect.GetInsideShapeSizeScalePropertyName(), "uInsideCircleSizeScale", TEST_LOCATION );
108 DALI_TEST_EQUALS( effect.GetOutsideShapeDepthPropertyName(), "uOutsideCircleDepth", TEST_LOCATION );
109 DALI_TEST_EQUALS( effect.GetEffectPixelAreaPropertyName(), "uEffectRegion", TEST_LOCATION );
110 DALI_TEST_EQUALS( effect.GetRectangleSizeScalePropertyName(), "uRectangleSizeScale", TEST_LOCATION );