X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Renderer.cpp;h=9ea907dee8f0c00d7971ff05e1910c868eb14588;hb=refs%2Fchanges%2F44%2F160544%2F1;hp=a8164ebc9ec78777317b39e4ac1f643292b7cfc0;hpb=2ebb744c449a7bfbc023c2dc7d8d28b9221022af;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Renderer.cpp b/automated-tests/src/dali/utc-Dali-Renderer.cpp index a8164eb..9ea907d 100644 --- a/automated-tests/src/dali/utc-Dali-Renderer.cpp +++ b/automated-tests/src/dali/utc-Dali-Renderer.cpp @@ -2278,6 +2278,8 @@ int UtcDaliRendererSetRenderModeToUseStencilBuffer(void) renderer.SetProperty( Renderer::Property::RENDER_MODE, RenderMode::COLOR ); ResetDebugAndFlush( application, glEnableDisableStack, glStencilFunctionStack ); renderer.SetProperty( Renderer::Property::RENDER_MODE, RenderMode::COLOR_STENCIL ); + // Set a different stencil function as the last one is cached. + renderer.SetProperty( Renderer::Property::STENCIL_FUNCTION, StencilFunction::ALWAYS ); ResetDebugAndFlush( application, glEnableDisableStack, glStencilFunctionStack ); DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Enable", GetStencilTestString() ) ); @@ -2443,7 +2445,7 @@ int UtcDaliRendererSetStencilOperation(void) }; const int StencilOperationLookupTableCount = sizeof( StencilOperationLookupTable ) / sizeof( StencilOperationLookupTable[0] ); // Set all 3 StencilOperation properties to a default. - renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_FAIL, StencilOperation::ZERO ); + renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_FAIL, StencilOperation::KEEP ); renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL, StencilOperation::ZERO ); renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_PASS, StencilOperation::ZERO ); @@ -2459,40 +2461,48 @@ int UtcDaliRendererSetStencilOperation(void) * - Checks the correct parameters to "glStencilFunc" were used * - Checks the above for all 3 parameter placements of StencilOperation ( OnFail, OnZFail, OnPass ) */ - int stencilOperationPropertyKeys[] = { Renderer::Property::STENCIL_OPERATION_ON_FAIL, Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL, Renderer::Property::STENCIL_OPERATION_ON_Z_PASS }; std::string methodString( "StencilOp" ); - for( int parameterIndex = 0; parameterIndex < 3; ++parameterIndex ) + for( int i = 0; i < StencilOperationLookupTableCount; ++i ) { - for( int i = 0; i < StencilOperationLookupTableCount; ++i ) + for( int j = 0; j < StencilOperationLookupTableCount; ++j ) { - // Set the property (outer loop causes all 3 different properties to be set separately). - renderer.SetProperty( stencilOperationPropertyKeys[ parameterIndex ], static_cast( i ) ); - - // Check GetProperty returns the same value. - DALI_TEST_EQUALS( static_cast( renderer.GetProperty( stencilOperationPropertyKeys[ parameterIndex ] ).Get() ), i, TEST_LOCATION ); - - // Reset the trace debug. - ResetDebugAndFlush( application, glEnableDisableStack, glStencilFunctionStack ); - - // Check the function is called and the parameters are correct. - // Set the expected parameter value at its correct index (only) - parameters[ parameterIndex ] = StencilOperationLookupTable[ i ]; - - // Build the parameter list. - std::stringstream parameterStream; - for( int parameterBuild = 0; parameterBuild < 3; ++parameterBuild ) + for( int k = 0; k < StencilOperationLookupTableCount; ++k ) { - parameterStream << parameters[ parameterBuild ]; - // Comma-separate the parameters. - if( parameterBuild < 2 ) + // Set the property (outer loop causes all 3 different properties to be set separately). + renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_FAIL, static_cast( i ) ); + renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL, static_cast( j ) ); + renderer.SetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_PASS, static_cast( k ) ); + + // Check GetProperty returns the same value. + DALI_TEST_EQUALS( static_cast( renderer.GetProperty( Renderer::Property::STENCIL_OPERATION_ON_FAIL ).Get() ), i, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast( renderer.GetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL ).Get() ), j, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast( renderer.GetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_PASS ).Get() ), k, TEST_LOCATION ); + + // Reset the trace debug. + ResetDebugAndFlush( application, glEnableDisableStack, glStencilFunctionStack ); + + // Check the function is called and the parameters are correct. + // Set the expected parameter value at its correct index (only) + parameters[ 0u ] = StencilOperationLookupTable[ i ]; + parameters[ 1u ] = StencilOperationLookupTable[ j ]; + parameters[ 2u ] = StencilOperationLookupTable[ k ]; + + // Build the parameter list. + std::stringstream parameterStream; + for( int parameterBuild = 0; parameterBuild < 3; ++parameterBuild ) { - parameterStream << ", "; + parameterStream << parameters[ parameterBuild ]; + // Comma-separate the parameters. + if( parameterBuild < 2 ) + { + parameterStream << ", "; + } } - } - // Check the function was called and the parameters were correct. - DALI_TEST_CHECK( glStencilFunctionStack.FindMethodAndParams( methodString, parameterStream.str() ) ); + // Check the function was called and the parameters were correct. + DALI_TEST_CHECK( glStencilFunctionStack.FindMethodAndParams( methodString, parameterStream.str() ) ); + } } }