X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-BubbleEmitter.cpp;h=1c464557384923489074edf79585d5a17cc0fdb7;hp=a4575fc84788e1cbf1622c19d46ebd4bcd1a9ec2;hb=HEAD;hpb=769d8e2c71710cc33eb6512682887eb2a05a64d9 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp index a4575fc..41e8236 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,17 @@ * */ -#include #include +#include // Need to override adaptor classes for toolkit test harness, so include // test harness headers before dali headers. #include -#include -#include #include #include +#include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -40,10 +40,8 @@ void utc_dali_toolkit_bubble_emitter_cleanup(void) test_return_value = TET_PASS; } - namespace { - const int RENDER_FRAME_INTERVAL = 16; static bool gObjectCreatedCallBackCalled; @@ -65,7 +63,7 @@ static int Wait(ToolkitTestApplication& application, int duration = 0) { int time = 0; - for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++) + for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++) { application.SendNotification(); application.Render(RENDER_FRAME_INTERVAL); @@ -75,13 +73,27 @@ static int Wait(ToolkitTestApplication& application, int duration = 0) return time; } -static Texture CreateSolidColorTexture( ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height ) +static Texture CreateSolidColorTexture(ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height) { - Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ); + Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height); + + int bufferSize = width * height * GetBytesPerPixel(Pixel::RGBA8888); + uint8_t* buffer = reinterpret_cast(malloc(bufferSize)); + + for(uint32_t i = 0; i < width * height; ++i) + { + buffer[i * 4 + 0] = static_cast(color.r * 255.0f); + buffer[i * 4 + 1] = static_cast(color.g * 255.0f); + buffer[i * 4 + 2] = static_cast(color.b * 255.0f); + buffer[i * 4 + 3] = static_cast(color.a * 255.0f); + } + + PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, Pixel::RGBA8888, PixelData::FREE); + texture.Upload(pixelData, 0u, 0u, 0u, 0u, width, height); + return texture; } -}//namespace - +} //namespace int UtcDaliBubbleEmitterNew(void) { @@ -91,32 +103,32 @@ int UtcDaliBubbleEmitterNew(void) // Test default constructor BubbleEmitter emitter; - DALI_TEST_CHECK( !emitter ); + DALI_TEST_CHECK(!emitter); // Test object creation - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); - DALI_TEST_CHECK( emitter ); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); + DALI_TEST_CHECK(emitter); // Additional check to ensure object is created by checking if it's registered - ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); - DALI_TEST_CHECK( registry ); + ObjectRegistry registry = application.GetCore().GetObjectRegistry(); + DALI_TEST_CHECK(registry); gObjectCreatedCallBackCalled = false; - registry.ObjectCreatedSignal().Connect( &TestCallback ); + registry.ObjectCreatedSignal().Connect(&TestCallback); { - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); } - DALI_TEST_CHECK( gObjectCreatedCallBackCalled ); + DALI_TEST_CHECK(gObjectCreatedCallBackCalled); // Test copy constructor - BubbleEmitter emitterCopy( emitter ); - DALI_TEST_CHECK( emitterCopy ); + BubbleEmitter emitterCopy(emitter); + DALI_TEST_CHECK(emitterCopy); // Test down cast Handle handleEmitter; - handleEmitter = emitter; - BubbleEmitter downCastEmitter = BubbleEmitter::DownCast( handleEmitter ); - DALI_TEST_CHECK( downCastEmitter ); + handleEmitter = emitter; + BubbleEmitter downCastEmitter = BubbleEmitter::DownCast(handleEmitter); + DALI_TEST_CHECK(downCastEmitter); END_TEST; } @@ -126,12 +138,12 @@ int UtcDaliBubbleEmitterDownCast01(void) tet_infoline(" UtcDaliBubbleEmitterDownCast01 "); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); - BaseHandle handle(emitter); + BaseHandle handle(emitter); BubbleEmitter emitter2 = BubbleEmitter::DownCast(handle); - DALI_TEST_EQUALS( (bool)emitter2, true, TEST_LOCATION ); + DALI_TEST_EQUALS((bool)emitter2, true, TEST_LOCATION); END_TEST; } @@ -141,44 +153,44 @@ int UtcDaliBubbleEmitterDownCast02(void) tet_infoline(" UtcDaliBubbleEmitterDownCast02 "); - Handle handle = Handle::New(); // Create a custom object + Handle handle = Handle::New(); // Create a custom object BubbleEmitter emitter = BubbleEmitter::DownCast(handle); - DALI_TEST_EQUALS( (bool)emitter, false, TEST_LOCATION ); + DALI_TEST_EQUALS((bool)emitter, false, TEST_LOCATION); END_TEST; } int UtcDaliBubbleEmitterGetRootActor(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterGetRootActor " ); + tet_infoline(" UtcDaliBubbleEmitterGetRootActor "); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 270, Vector2( 5.f, 10.f )); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 270, Vector2(5.f, 10.f)); Actor root = emitter.GetRootActor(); - DALI_TEST_CHECK( root ); - DALI_TEST_CHECK( root.GetChildCount() == 0 ); + DALI_TEST_CHECK(root); + DALI_TEST_CHECK(root.GetChildCount() == 0); END_TEST; } int UtcDaliBubbleEmitterSetBackground(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterSetBackground " ); + tet_infoline(" UtcDaliBubbleEmitterSetBackground "); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); - RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); - unsigned int taskCount = taskList.GetTaskCount(); + RenderTaskList taskList = application.GetScene().GetRenderTaskList(); + unsigned int taskCount = taskList.GetTaskCount(); - Texture bgImage = CreateSolidColorTexture( application, Color::RED, 50, 50 ); - emitter.SetBackground( bgImage, Vector3(0.f, 0.f, 0.5f) ); + Texture bgImage = CreateSolidColorTexture(application, Color::RED, 50, 50); + emitter.SetBackground(bgImage, Vector3(0.f, 0.f, 0.5f)); - DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount+1 ); + DALI_TEST_CHECK(taskList.GetTaskCount() == taskCount + 1); Wait(application, 500); - DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount ); + DALI_TEST_CHECK(taskList.GetTaskCount() == taskCount); END_TEST; } @@ -191,34 +203,42 @@ int UtcDaliBubbleEmitterSetBackground(void) int UtcDaliBubbleEmitterSetBubbleScale(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterSetBubbleScale " ); + tet_infoline(" UtcDaliBubbleEmitterSetBubbleScale "); + + static std::vector customUniforms = + { + UniformData("uDynamicScale", Property::Type::FLOAT), + }; - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f )); + TestGraphicsController& graphics = application.GetGraphicsController(); + graphics.AddCustomUniforms(customUniforms); + + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 150, Vector2(5.f, 10.f)); DALI_TEST_CHECK(emitter); Actor root = emitter.GetRootActor(); - Stage::GetCurrent().Add( root ); - root.SetPosition( Vector3::ZERO ); - root.SetParentOrigin( ParentOrigin::CENTER ); - root.SetAnchorPoint( AnchorPoint::CENTER ); + application.GetScene().Add(root); + root.SetProperty(Actor::Property::POSITION, Vector3::ZERO); + root.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + root.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); TestGlAbstraction& gl = application.GetGlAbstraction(); Wait(application); float scaleValue; - DALI_TEST_CHECK( gl.GetUniformValue( "uDynamicScale", scaleValue ) ); - DALI_TEST_EQUALS( scaleValue, 1.f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uDynamicScale", scaleValue)); + DALI_TEST_EQUALS(scaleValue, 1.f, TEST_LOCATION); - emitter.SetBubbleScale( 2.f ); + emitter.SetBubbleScale(2.f); Wait(application); - DALI_TEST_CHECK( gl.GetUniformValue( "uDynamicScale", scaleValue ) ); - DALI_TEST_EQUALS( scaleValue, 2.f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uDynamicScale", scaleValue)); + DALI_TEST_EQUALS(scaleValue, 2.f, TEST_LOCATION); - emitter.SetBubbleScale( 0.5f ); + emitter.SetBubbleScale(0.5f); Wait(application); - DALI_TEST_CHECK( gl.GetUniformValue( "uDynamicScale", scaleValue ) ); - DALI_TEST_EQUALS( scaleValue, 0.5f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uDynamicScale", scaleValue)); + DALI_TEST_EQUALS(scaleValue, 0.5f, TEST_LOCATION); END_TEST; } @@ -226,20 +246,20 @@ int UtcDaliBubbleEmitterSetBubbleScale(void) int UtcDaliBubbleEmitterSetBubbleDensity01(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " ); + tet_infoline(" UtcDaliBubbleEmitterSetBubbleDensity "); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); try { - emitter.SetBubbleDensity( 3.f ); + emitter.SetBubbleDensity(3.f); DALI_TEST_CHECK(true); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION ); + DALI_TEST_PRINT_ASSERT(e); + DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION); } END_TEST; } @@ -247,19 +267,19 @@ int UtcDaliBubbleEmitterSetBubbleDensity01(void) int UtcDaliBubbleEmitterSetBubbleDensity02(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " ); + tet_infoline(" UtcDaliBubbleEmitterSetBubbleDensity "); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f)); try { - emitter.SetBubbleDensity( 10.f ); + emitter.SetBubbleDensity(10.f); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION ); + DALI_TEST_PRINT_ASSERT(e); + DALI_TEST_ASSERT(e, "density > 0 && density <= 9", TEST_LOCATION); } END_TEST; } @@ -267,100 +287,113 @@ int UtcDaliBubbleEmitterSetBubbleDensity02(void) int UtcDaliBubbleEmitterEmitBubble(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterEmitBubble " ); - - Texture shapeImage1 = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f )); - - Actor root = emitter.GetRootActor(); - Renderer bubbleRenderer = root.GetRendererAt( 0 ); - Stage::GetCurrent().Add( root ); - DALI_TEST_CHECK( bubbleRenderer ); - - Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" ); - Property::Index propertyIndex1 = bubbleRenderer.GetPropertyIndex( "uPercentage[1]" ); - float value0, value1; - - Animation animation = Animation::New( 0.5f ); - emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) ); - emitter.EmitBubble( animation, Vector2(10.f,10.f), Vector2(5.f,5.f), Vector2(30.f,30.f) ); - (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 ); - (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 ); - DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION ); - DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION ); + tet_infoline(" UtcDaliBubbleEmitterEmitBubble "); + + Texture shapeImage1 = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage1, 200, Vector2(5.f, 10.f)); + + Actor root = emitter.GetRootActor(); + Renderer bubbleRenderer = root.GetRendererAt(0); + application.GetScene().Add(root); + DALI_TEST_CHECK(bubbleRenderer); + + Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex("uPercentage[0]"); + Property::Index propertyIndex1 = bubbleRenderer.GetPropertyIndex("uPercentage[1]"); + float value0, value1; + + Animation animation = Animation::New(0.5f); + emitter.EmitBubble(animation, Vector2(40.f, 40.f), Vector2(-5.f, -5.f), Vector2(30.f, 30.f)); + emitter.EmitBubble(animation, Vector2(10.f, 10.f), Vector2(5.f, 5.f), Vector2(30.f, 30.f)); + (bubbleRenderer.GetProperty(propertyIndex0)).Get(value0); + (bubbleRenderer.GetProperty(propertyIndex1)).Get(value1); + DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION); + DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1); + DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION); + DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION); animation.Play(); Wait(application, 300); - propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" ); - propertyIndex1 = bubbleRenderer.GetPropertyIndex( "uPercentage[1]" ); - (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 ); - (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 ); - DALI_TEST_CHECK( value0 >= 0.6f ); - DALI_TEST_CHECK( value1 >= 0.6f ); - - Wait(application,500); - (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 ); - (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 ); - DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION ); - DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION ); + propertyIndex0 = bubbleRenderer.GetPropertyIndex("uPercentage[0]"); + propertyIndex1 = bubbleRenderer.GetPropertyIndex("uPercentage[1]"); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1); + DALI_TEST_CHECK(value0 >= 0.6f); + DALI_TEST_CHECK(value1 >= 0.6f); + + Wait(application, 500); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0); + (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1); + DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION); + DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION); END_TEST; } int UtcDaliBubbleEmitterRestore(void) { ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterRestore " ); + tet_infoline(" UtcDaliBubbleEmitterRestore "); - Vector2 movementArea(50.f,50.f); - Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( movementArea,shapeImage, 90, Vector2( 5.f, 10.f )); - Actor root = emitter.GetRootActor(); - Stage::GetCurrent().Add( root ); - root.SetPosition( Vector3::ZERO ); - root.SetParentOrigin( ParentOrigin::CENTER ); - root.SetAnchorPoint( AnchorPoint::CENTER ); + static std::vector customUniforms = + { + UniformData("uPercentage[90]", Property::Type::FLOAT), + UniformData("uStartEndPosition[90]", Property::Type::VECTOR4), + }; + + TestGraphicsController& graphics = application.GetGraphicsController(); + graphics.AddCustomUniforms(customUniforms); + + Vector2 movementArea(50.f, 50.f); + Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5); + BubbleEmitter emitter = BubbleEmitter::New(movementArea, shapeImage, 90, Vector2(5.f, 10.f)); + Actor root = emitter.GetRootActor(); + application.GetScene().Add(root); + root.SetProperty(Actor::Property::POSITION, Vector3::ZERO); + root.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + root.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); - Renderer renderer = root.GetRendererAt( 0 ); - DALI_TEST_CHECK( renderer ); + Renderer renderer = root.GetRendererAt(0); + DALI_TEST_CHECK(renderer); TestGlAbstraction& gl = application.GetGlAbstraction(); - float percentageValue; + float percentageValue; Vector4 startEndPosValue; - Animation animation = Animation::New( 0.5f ); - emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) ); + Animation animation = Animation::New(0.5f); + emitter.EmitBubble(animation, Vector2(40.f, 40.f), Vector2(-5.f, -5.f), Vector2(30.f, 30.f)); Wait(application); - DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); - DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uPercentage[0]", percentageValue)); + DALI_TEST_EQUALS(percentageValue, 0.f, TEST_LOCATION); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); - DALI_TEST_EQUALS( startEndPosValue.x, 40.f - movementArea.x*0.5f, TEST_LOCATION ); - DALI_TEST_EQUALS( startEndPosValue.y, 40.f- movementArea.x*0.5f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uStartEndPosition[0]", startEndPosValue)); + DALI_TEST_EQUALS(startEndPosValue.x, 40.f - movementArea.x * 0.5f, TEST_LOCATION); + DALI_TEST_EQUALS(startEndPosValue.y, 40.f - movementArea.x * 0.5f, TEST_LOCATION); animation.Play(); Wait(application, 200); animation.Clear(); - DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); - DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4); + DALI_TEST_CHECK(gl.GetUniformValue("uPercentage[0]", percentageValue)); + DALI_TEST_CHECK(percentageValue < 0.5f && percentageValue >= 0.4); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); - DALI_TEST_EQUALS( startEndPosValue.x, 40.f- movementArea.x*0.5f, TEST_LOCATION ); - DALI_TEST_EQUALS( startEndPosValue.y, 40.f- movementArea.x*0.5f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uStartEndPosition[0]", startEndPosValue)); + DALI_TEST_EQUALS(startEndPosValue.x, 40.f - movementArea.x * 0.5f, TEST_LOCATION); + DALI_TEST_EQUALS(startEndPosValue.y, 40.f - movementArea.x * 0.5f, TEST_LOCATION); emitter.Restore(); application.SendNotification(); application.Render(); - DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); - DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uPercentage[0]", percentageValue)); + DALI_TEST_EQUALS(percentageValue, 0.f, TEST_LOCATION); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); - DALI_TEST_EQUALS( startEndPosValue, Vector4::ZERO, TEST_LOCATION ); + DALI_TEST_CHECK(gl.GetUniformValue("uStartEndPosition[0]", startEndPosValue)); + DALI_TEST_EQUALS(startEndPosValue, Vector4::ZERO, TEST_LOCATION); END_TEST; }