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.
20 #include <dali-toolkit-test-suite-utils.h>
21 #include <dali-toolkit/dali-toolkit.h>
27 void blind_effect_startup(void)
29 test_return_value = TET_UNDEF;
32 void blind_effect_cleanup(void)
34 test_return_value = TET_PASS;
38 int UtcDaliBlindEffectUninitialized(void)
40 ToolkitTestApplication application;
42 Toolkit::BlindEffect effect;
46 // New() must be called to create a BlindEffect or it wont be valid.
47 effect.SetStep( 2.0f );
48 DALI_TEST_CHECK( false );
50 catch (Dali::DaliException& e)
52 // Tests that a negative test of an assertion succeeds
53 tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
54 DALI_TEST_CHECK(!effect);
59 int UtcDaliBlindEffectPropertyNames(void)
61 ToolkitTestApplication application;
63 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
65 // Check the names, this names are used in the shaders code,
66 // if they change the shader code has to be updated
67 DALI_TEST_EQUALS( effect.GetStepPropertyName(), "uStep", TEST_LOCATION );
71 int UtcDaliBlindEffectDefaultValues(void)
73 ToolkitTestApplication application;
75 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
76 DALI_TEST_CHECK( effect );
78 BitmapImage image = CreateBitmapImage();
80 ImageActor actor = ImageActor::New( image );
81 actor.SetSize( 100.0f, 100.0f );
82 actor.SetShaderEffect( effect );
83 Stage::GetCurrent().Add( actor );
85 application.SendNotification();
88 // Gets converted to opengl viewport coordinates
90 application.GetGlAbstraction().CheckUniformValue(
91 effect.GetStepPropertyName().c_str(),
96 int UtcDaliBlindEffectCustomValues(void)
98 ToolkitTestApplication application;
100 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
101 DALI_TEST_CHECK( effect );
103 BitmapImage image = CreateBitmapImage();
105 ImageActor actor = ImageActor::New( image );
106 actor.SetSize( 100.0f, 100.0f );
108 effect.SetStep( 2.0f );
110 actor.SetShaderEffect(effect);
111 Stage::GetCurrent().Add(actor);
113 application.SendNotification();
114 application.Render();
116 // Gets converted to opengl viewport coordinates
118 application.GetGlAbstraction().CheckUniformValue(
119 effect.GetStepPropertyName().c_str(),