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.
21 #include <dali-toolkit-test-suite-utils.h>
22 #include <dali-toolkit/dali-toolkit.h>
28 void blind_effect_startup(void)
30 test_return_value = TET_UNDEF;
33 void blind_effect_cleanup(void)
35 test_return_value = TET_PASS;
39 int UtcDaliBlindEffectUninitialized(void)
41 ToolkitTestApplication application;
43 Toolkit::BlindEffect effect;
47 // New() must be called to create a BlindEffect or it wont be valid.
48 effect.SetStep( 2.0f );
49 DALI_TEST_CHECK( false );
51 catch (Dali::DaliException& e)
53 // Tests that a negative test of an assertion succeeds
54 tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
55 DALI_TEST_CHECK(!effect);
60 int UtcDaliBlindEffectPropertyNames(void)
62 ToolkitTestApplication application;
64 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
66 // Check the names, this names are used in the shaders code,
67 // if they change the shader code has to be updated
68 DALI_TEST_EQUALS( effect.GetStepPropertyName(), "uStep", TEST_LOCATION );
72 int UtcDaliBlindEffectDefaultValues(void)
74 ToolkitTestApplication application;
76 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
77 DALI_TEST_CHECK( effect );
79 BitmapImage image = CreateBitmapImage();
81 ImageActor actor = ImageActor::New( image );
82 actor.SetSize( 100.0f, 100.0f );
83 actor.SetShaderEffect( effect );
84 Stage::GetCurrent().Add( actor );
86 application.SendNotification();
89 // Gets converted to opengl viewport coordinates
91 application.GetGlAbstraction().CheckUniformValue(
92 effect.GetStepPropertyName().c_str(),
97 int UtcDaliBlindEffectCustomValues(void)
99 ToolkitTestApplication application;
101 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
102 DALI_TEST_CHECK( effect );
104 BitmapImage image = CreateBitmapImage();
106 ImageActor actor = ImageActor::New( image );
107 actor.SetSize( 100.0f, 100.0f );
109 effect.SetStep( 2.0f );
111 actor.SetShaderEffect(effect);
112 Stage::GetCurrent().Add(actor);
114 application.SendNotification();
115 application.Render();
117 // Gets converted to opengl viewport coordinates
119 application.GetGlAbstraction().CheckUniformValue(
120 effect.GetStepPropertyName().c_str(),