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-Visual.cpp;h=79b42f62be644dc5fc79ee4baaf54a176d145861;hp=7d77a1bbeeec623eb42e77f1f3dcea754d5b3ebf;hb=7a89f514e362aa247816f35ed9e630ce7bf1b2b0;hpb=6ebbbf8ac1bc813b1f34950e4f76d6f55b304495 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 7d77a1b..79b42f6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -2051,7 +2051,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); - Renderer renderer = actor.GetRendererAt(0); + Renderer renderer = actor.GetRendererAt(0); const Vector4 INITIAL_MIX_COLOR(1.0f, 0.0f, 1.0f, 0.5f); // Magenta with half alpha const Vector4 TARGET_MIX_COLOR(Color::RED); @@ -3743,11 +3743,9 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius)), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); -#endif } // color visual 2 @@ -3778,11 +3776,9 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::RELATIVE), true, TEST_LOCATION); -#endif } // color visual 3 - invalid value @@ -3813,12 +3809,10 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); // Default corner radius policy is absolute. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); -#endif } // gradient visual @@ -3863,12 +3857,9 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius)), true, TEST_LOCATION); // Default corner radius policy is absolute. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); -#endif } // animated image visual @@ -3902,11 +3893,8 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); -#endif } // vector image visual @@ -3938,12 +3926,9 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); // Default corner radius policy is absolute. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); -#endif } // animated vector image visual @@ -3977,11 +3962,8 @@ int UtcDaliVisualRoundedCorner(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius)), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::RELATIVE), true, TEST_LOCATION); -#endif } END_TEST; @@ -4080,13 +4062,10 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", borderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", borderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", borderlineOffset), true, TEST_LOCATION); -#endif } // color visual 2, default color, default offset @@ -4116,14 +4095,11 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", borderlineWidth), true, TEST_LOCATION); // Default borderline color is BLACK. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", Color::BLACK), true, TEST_LOCATION); // Default borderline offset is 0.0f. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", 0.0f), true, TEST_LOCATION); -#endif } // color visual 3, offset not [-1.0 ~ 1.0], but uniform value is same anyway @@ -4157,13 +4133,10 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", borderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", borderlineColor), true, TEST_LOCATION); // NOTE : borderlineOffset will clamp in fragment shader. not visual itself DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", borderlineOffset), true, TEST_LOCATION); -#endif } // gradient visual @@ -4210,8 +4183,6 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius)), true, TEST_LOCATION); // Default corner radius policy is absolute. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); @@ -4220,7 +4191,6 @@ int UtcDaliVisualBorderline(void) DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", Color::BLACK), true, TEST_LOCATION); // Default borderline offset is 0.0f. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", 0.0f), true, TEST_LOCATION); -#endif } // animated image visual @@ -4255,13 +4225,10 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", borderlineWidth), true, TEST_LOCATION); // Default borderline color is BLACK. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", Color::BLACK), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", borderlineOffset), true, TEST_LOCATION); -#endif } // vector image visual @@ -4297,8 +4264,6 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); // Default corner radius policy is absolute. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE), true, TEST_LOCATION); @@ -4306,7 +4271,6 @@ int UtcDaliVisualBorderline(void) DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", borderlineColor), true, TEST_LOCATION); // Default borderline offset is 0.0. DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", 0.0f), true, TEST_LOCATION); -#endif } // animated vector image visual @@ -4345,14 +4309,11 @@ int UtcDaliVisualBorderline(void) application.SendNotification(); application.Render(); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", cornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::RELATIVE), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", borderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", borderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", borderlineOffset), true, TEST_LOCATION); -#endif } END_TEST; @@ -4824,7 +4785,7 @@ int UtcDaliVisualGetVisualProperty01(void) float targetBlurRadius = 10.0f; float targetBorderlineWidth = 25.0f; Vector4 targetBorderlineColor(1.0f, 1.0f, 1.0f, 1.0f); - float targetBorderlineOffset = -1.0f; + float targetBorderlineOffset = -1.0f; float targetPreMultipliedAlpha = 1.0f; Animation animation = Animation::New(1.0f); @@ -5007,15 +4968,12 @@ int UtcDaliVisualGetVisualProperty02(void) DALI_TEST_CHECK(blurRadiusValue); DALI_TEST_EQUALS(blurRadiusValue->Get(), targetBlurRadius, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day // Test uniform values DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("mixColor", targetColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("offset", targetOffset), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("size", targetSize), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("blurRadius", targetBlurRadius), true, TEST_LOCATION); -#endif END_TEST; } @@ -5097,14 +5055,11 @@ int UtcDaliVisualGetVisualProperty03(void) DALI_TEST_CHECK(borderlineOffsetValue); DALI_TEST_EQUALS(borderlineOffsetValue->Get(), targetBorderlineOffset, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day // Test uniform value DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", targetBorderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", targetBorderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", targetBorderlineOffset), true, TEST_LOCATION); -#endif END_TEST; } @@ -5171,11 +5126,8 @@ int UtcDaliVisualGetVisualProperty04(void) DALI_TEST_CHECK(cornerRadiusValue); DALI_TEST_EQUALS(cornerRadiusValue->Get(), targetCornerRadius, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST - // Currently test with multiple program doesn't work well. will fix another day // Test uniform value DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); -#endif END_TEST; } @@ -5260,14 +5212,12 @@ int UtcDaliVisualGetVisualProperty05(void) DALI_TEST_CHECK(borderlineOffsetValue); DALI_TEST_EQUALS(borderlineOffsetValue->Get(), targetBorderlineOffset, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day // Test uniform value DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", targetBorderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", targetBorderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", targetBorderlineOffset), true, TEST_LOCATION); -#endif END_TEST; } @@ -5352,14 +5302,12 @@ int UtcDaliVisualGetVisualProperty06(void) DALI_TEST_CHECK(borderlineOffsetValue); DALI_TEST_EQUALS(borderlineOffsetValue->Get(), targetBorderlineOffset, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day // Test uniform value DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", targetBorderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", targetBorderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", targetBorderlineOffset), true, TEST_LOCATION); -#endif END_TEST; } @@ -5444,14 +5392,12 @@ int UtcDaliVisualGetVisualProperty07(void) DALI_TEST_CHECK(borderlineOffsetValue); DALI_TEST_EQUALS(borderlineOffsetValue->Get(), targetBorderlineOffset, TEST_LOCATION); -#ifdef OLD_GRAPHICS_TEST // Currently test with multiple program doesn't work well. will fix another day // Test uniform value DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("cornerRadius", targetCornerRadius), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineWidth", targetBorderlineWidth), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineColor", targetBorderlineColor), true, TEST_LOCATION); DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue("borderlineOffset", targetBorderlineOffset), true, TEST_LOCATION); -#endif END_TEST; } @@ -6122,21 +6068,21 @@ int UtcDaliVisualUpdatePropertyChangeShader03(void) int UtcDaliVisualUpdatePropertyChangeShader04(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualUpdatePropertyChangeShader04: Test update property by DoAction during Animation. Change the shader case" ); + tet_infoline("UtcDaliVisualUpdatePropertyChangeShader04: Test update property by DoAction during Animation. Change the shader case"); TraceCallStack& callStack = application.GetGraphicsController().mCallStack; VisualFactory factory = VisualFactory::Get(); Property::Map propertyMap; // Case ImageVisual - propertyMap[Visual::Property::TYPE] = Visual::Type::IMAGE; - propertyMap[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME; + propertyMap[Visual::Property::TYPE] = Visual::Type::IMAGE; + propertyMap[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME; propertyMap[DevelVisual::Property::CORNER_RADIUS] = 10.0f; Visual::Base imageVisual = factory.CreateVisual(propertyMap); - DummyControl dummyControl = DummyControl::New(true); - Impl::DummyControl& dummyImpl = static_cast(dummyControl.GetImplementation()); + DummyControl dummyControl = DummyControl::New(true); + Impl::DummyControl& dummyImpl = static_cast(dummyControl.GetImplementation()); dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, imageVisual); dummyControl[Actor::Property::SIZE] = Vector2(200.f, 200.f); application.GetScene().Add(dummyControl); @@ -6152,24 +6098,24 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void) // Get shader { - Renderer renderer = dummyControl.GetRendererAt( 0 ); - Shader shader = renderer.GetShader(); - Property::Value value = shader.GetProperty( Shader::Property::PROGRAM ); - Property::Map* map = value.GetMap(); - DALI_TEST_CHECK( map ); - - Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp - DALI_TEST_CHECK( fragment ); + Renderer renderer = dummyControl.GetRendererAt(0); + Shader shader = renderer.GetShader(); + Property::Value value = shader.GetProperty(Shader::Property::PROGRAM); + Property::Map* map = value.GetMap(); + DALI_TEST_CHECK(map); + + Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp + DALI_TEST_CHECK(fragment); std::string fragmentShader; - DALI_TEST_CHECK( fragment->Get(fragmentShader) ); - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos ); - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); - - Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp - std::string vertexShader; - DALI_TEST_CHECK( vertex->Get(vertexShader) ); - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos ); - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); + DALI_TEST_CHECK(fragment->Get(fragmentShader)); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); + + Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp + std::string vertexShader; + DALI_TEST_CHECK(vertex->Get(vertexShader)); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); } callStack.Reset(); callStack.Enable(true); @@ -6186,30 +6132,30 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void) // Get shader { - Renderer renderer = dummyControl.GetRendererAt( 0 ); - Shader shader = renderer.GetShader(); - Property::Value value = shader.GetProperty( Shader::Property::PROGRAM ); - Property::Map* map = value.GetMap(); - DALI_TEST_CHECK( map ); - - Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp - DALI_TEST_CHECK( fragment ); + Renderer renderer = dummyControl.GetRendererAt(0); + Shader shader = renderer.GetShader(); + Property::Value value = shader.GetProperty(Shader::Property::PROGRAM); + Property::Map* map = value.GetMap(); + DALI_TEST_CHECK(map); + + Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp + DALI_TEST_CHECK(fragment); std::string fragmentShader; - DALI_TEST_CHECK( fragment->Get(fragmentShader) ); - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos ); + DALI_TEST_CHECK(fragment->Get(fragmentShader)); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos); // Note : mAlwaysUsingCornerRadius is true. - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); - Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp - std::string vertexShader; - DALI_TEST_CHECK( vertex->Get(vertexShader) ); - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos ); + Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp + std::string vertexShader; + DALI_TEST_CHECK(vertex->Get(vertexShader)); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos); // Note : mAlwaysUsingCornerRadius is true. - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); } callStack.Enable(false); // Shader not changed - DALI_TEST_CHECK( !callStack.FindMethod("CreateShader") ); + DALI_TEST_CHECK(!callStack.FindMethod("CreateShader")); callStack.Reset(); callStack.Enable(true); @@ -6221,7 +6167,7 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void) DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, DevelVisual::Action::UPDATE_PROPERTY, targetPropertyMap); Property::Map resultMap; - imageVisual.CreatePropertyMap( resultMap ); + imageVisual.CreatePropertyMap(resultMap); // Test property values: they should be updated Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4); @@ -6238,26 +6184,26 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void) // Get shader { - Renderer renderer = dummyControl.GetRendererAt( 0 ); - Shader shader = renderer.GetShader(); - Property::Value value = shader.GetProperty( Shader::Property::PROGRAM ); - Property::Map* map = value.GetMap(); - DALI_TEST_CHECK( map ); - - Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp - DALI_TEST_CHECK( fragment ); + Renderer renderer = dummyControl.GetRendererAt(0); + Shader shader = renderer.GetShader(); + Property::Value value = shader.GetProperty(Shader::Property::PROGRAM); + Property::Map* map = value.GetMap(); + DALI_TEST_CHECK(map); + + Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp + DALI_TEST_CHECK(fragment); std::string fragmentShader; - DALI_TEST_CHECK( fragment->Get(fragmentShader) ); - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos ); + DALI_TEST_CHECK(fragment->Get(fragmentShader)); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos); // Note : mAlwaysUsingCornerRadius is true. - DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); + DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); - Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp - std::string vertexShader; - DALI_TEST_CHECK( vertex->Get(vertexShader) ); - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos ); + Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp + std::string vertexShader; + DALI_TEST_CHECK(vertex->Get(vertexShader)); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos); // Note : mAlwaysUsingCornerRadius is true. - DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos ); + DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos); } // Send shader compile signal @@ -6266,7 +6212,7 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void) callStack.Enable(false); // Shader changed - DALI_TEST_CHECK( callStack.FindMethod("CreateShader") ); + DALI_TEST_CHECK(callStack.FindMethod("CreateShader")); END_TEST; }