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 // Need to override adaptor classes for toolkit test harness, so include
21 // test harness headers before dali headers.
22 #include <dali-toolkit-test-suite-utils.h>
25 #include <dali-toolkit/dali-toolkit.h>
30 void utc_dali_toolkit_ripple_2d_effect_startup(void)
32 test_return_value = TET_UNDEF;
35 void utc_dali_toolkit_ripple_2d_effect_cleanup(void)
37 test_return_value = TET_PASS;
40 int UtcDaliRipple2DEffectUninitialized(void)
42 ToolkitTestApplication application;
44 Toolkit::Ripple2DEffect effect;
48 // New() must be called to create a Ripple2DEffect or it wont be valid.
49 effect.SetAmplitude( 0.5f );
50 DALI_TEST_CHECK( false );
52 catch (Dali::DaliException& e)
54 // Tests that a negative test of an assertion succeeds
55 tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
56 DALI_TEST_CHECK(!effect);
61 int UtcDaliRipple2DEffectPropertyNames(void)
63 ToolkitTestApplication application;
65 Toolkit::Ripple2DEffect effect = Toolkit::Ripple2DEffect::New();
67 // Check the names, this names are used in the shaders code,
68 // if they change the shader code has to be updated
69 DALI_TEST_EQUALS( effect.GetAmplitudePropertyName(), "uAmplitude", TEST_LOCATION );
70 DALI_TEST_EQUALS( effect.GetTimePropertyName(), "uTime", TEST_LOCATION );
74 int UtcDaliRipple2DEffectDefaultValues(void)
76 ToolkitTestApplication application;
78 Toolkit::Ripple2DEffect effect = Toolkit::Ripple2DEffect::New();
79 DALI_TEST_CHECK( effect );
81 BitmapImage image = CreateBitmapImage();
83 ImageActor actor = ImageActor::New( image );
84 actor.SetSize( 100.0f, 100.0f );
85 actor.SetShaderEffect( effect );
86 Stage::GetCurrent().Add( actor );
88 application.SendNotification();
92 application.GetGlAbstraction().CheckUniformValue(
93 effect.GetAmplitudePropertyName().c_str(),
96 application.GetGlAbstraction().CheckUniformValue(
97 effect.GetTimePropertyName().c_str(),
102 int UtcDaliRipple2DEffectCustomValues(void)
104 ToolkitTestApplication application;
106 Toolkit::Ripple2DEffect effect = Toolkit::Ripple2DEffect::New();
107 DALI_TEST_CHECK( effect );
109 BitmapImage image = CreateBitmapImage();
111 ImageActor actor = ImageActor::New( image );
112 actor.SetSize( 100.0f, 100.0f );
113 actor.SetShaderEffect( effect );
115 effect.SetAmplitude( 5.0f );
116 effect.SetTime( 2.0f );
118 Stage::GetCurrent().Add( actor );
120 application.SendNotification();
121 application.Render();
124 application.GetGlAbstraction().CheckUniformValue(
125 effect.GetAmplitudePropertyName().c_str(),
128 application.GetGlAbstraction().CheckUniformValue(
129 effect.GetTimePropertyName().c_str(),