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.
19 #include <dali-toolkit-test-suite-utils.h>
20 #include <dali-toolkit/dali-toolkit.h>
24 using namespace Dali::Toolkit;
26 void overlay_effect_startup(void)
28 test_return_value = TET_UNDEF;
31 void overlay_effect_cleanup(void)
33 test_return_value = TET_PASS;
37 int UtcDaliOverlayConstructor(void)
39 ToolkitTestApplication application;
41 BitmapImage image = CreateBitmapImage();
43 Toolkit::OverlayEffect effect = Toolkit::OverlayEffect::New( image );
44 DALI_TEST_CHECK( effect );
46 ImageActor actor = ImageActor::New( image );
47 actor.SetSize( 100.0f, 100.0f );
48 actor.SetShaderEffect( effect );
49 Stage::GetCurrent().Add( actor );
51 application.SendNotification();
57 int UtcDaliOverlayUninitializedEffect(void)
59 ToolkitTestApplication application;
61 Toolkit::OverlayEffect effect;
65 BitmapImage image = CreateBitmapImage();
67 // New() must be called to create a OverlayEffect or it wont be valid.
68 effect.SetEffectImage( image );
69 DALI_TEST_CHECK( false );
71 catch (Dali::DaliException& e)
73 // Tests that a negative test of an assertion succeeds
74 tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
75 DALI_TEST_CHECK(!effect);