X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-BubbleEmitter.cpp;h=4c711f38a9678883a06ccc34bc827518e48a3126;hb=d00a250741411c386d988e7ac34525cf94a1918e;hp=db8a9df7c008fc38fafb67c28e51c8204907a9f2;hpb=1c5674a11a51310ee689d6daf4e6b7d94dec607e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp index db8a9df..4c711f3 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) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -214,8 +215,12 @@ int UtcDaliBubbleEmitterSetBubbleScale(void) Image shapeImage = CreateSolidColorImage( 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 ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -234,6 +239,7 @@ int UtcDaliBubbleEmitterSetBubbleScale(void) Wait(application); DALI_TEST_CHECK( gl.GetUniformValue( "uDynamicScale", scaleValue ) ); DALI_TEST_EQUALS( scaleValue, 0.5f, TEST_LOCATION ); + END_TEST; } @@ -278,40 +284,6 @@ int UtcDaliBubbleEmitterSetBubbleDensity02(void) END_TEST; } -int UtcDaliBubbleEmitterSetBlendMode(void) -{ - ToolkitTestApplication application; - tet_infoline( " UtcDaliBubbleEmitterSetBlendMode " ); - - Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 ); - BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f )); - Actor root = emitter.GetRootActor(); - Stage::GetCurrent().Add( root ); - - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - Wait(application); - DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION ); - - emitter.SetBlendMode( true ); - Wait(application); - DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ZERO, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION ); - - emitter.SetBlendMode( false ); - Wait(application); - DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION ); - DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION ); - - END_TEST; -} - int UtcDaliBubbleEmitterEmitBubble(void) { ToolkitTestApplication application; @@ -325,8 +297,8 @@ int UtcDaliBubbleEmitterEmitBubble(void) Stage::GetCurrent().Add( root ); DALI_TEST_CHECK( bubbleMesh ); - Property::Index propertyIndex0 = bubbleMesh.GetPropertyIndex( "percentage-0" ); - Property::Index propertyIndex1 = bubbleMesh.GetPropertyIndex( "percentage-1" ); + Property::Index propertyIndex0 = bubbleMesh.GetPropertyIndex( "uPercentage[0]" ); + Property::Index propertyIndex1 = bubbleMesh.GetPropertyIndex( "uPercentage[1]" ); float value0, value1; Animation animation = Animation::New( 0.5f ); @@ -340,8 +312,8 @@ int UtcDaliBubbleEmitterEmitBubble(void) animation.Play(); Wait(application, 300); - propertyIndex0 = bubbleMesh.GetPropertyIndex( "percentage-0" ); - propertyIndex1 = bubbleMesh.GetPropertyIndex( "percentage-1" ); + propertyIndex0 = bubbleMesh.GetPropertyIndex( "uPercentage[0]" ); + propertyIndex1 = bubbleMesh.GetPropertyIndex( "uPercentage[1]" ); (bubbleMesh.GetProperty(propertyIndex0)).Get( value0 ); (bubbleMesh.GetProperty(propertyIndex1)).Get( value1 ); DALI_TEST_CHECK( value0 >= 0.6f ); @@ -364,6 +336,9 @@ int UtcDaliBubbleEmitterRestore(void) BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),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 ); Actor bubbleMesh = root.GetChildAt( 0 ); Renderer renderer = bubbleMesh.GetRendererAt( 0 ); @@ -382,7 +357,7 @@ int UtcDaliBubbleEmitterRestore(void) DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION ); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartAndEndPos[0]", startEndPosValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION ); DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION ); @@ -393,7 +368,7 @@ int UtcDaliBubbleEmitterRestore(void) DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartAndEndPos[0]", startEndPosValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION ); DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION ); @@ -404,7 +379,8 @@ int UtcDaliBubbleEmitterRestore(void) DALI_TEST_CHECK( gl.GetUniformValue( "uPercentage[0]", percentageValue ) ); DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION ); - DALI_TEST_CHECK( gl.GetUniformValue( "uStartAndEndPos[0]", startEndPosValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); DALI_TEST_EQUALS( startEndPosValue, Vector4::ZERO, TEST_LOCATION ); + END_TEST; }