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-ControlRenderer.cpp;h=a74af9052f127b3cbb9ef857ddb8749205039b0b;hp=e0b50d19fb14bb9d2cbd5fc53afd2f526f63afd9;hb=f3da11c2818c6d17706fbb2417f21b602b3190f5;hpb=4c1f4bfb9eb5b956b64a6c9bf077217fc0ca9234 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp index e0b50d1..a74af90 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp @@ -48,8 +48,8 @@ int UtcDaliControlRendererCopyAndAssignment(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "color-renderer"); - propertyMap.Insert("blend-color", Color::BLUE); + propertyMap.Insert("rendererType", "colorRenderer"); + propertyMap.Insert("blendColor", Color::BLUE); ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap ); ControlRenderer controlRendererCopy( controlRenderer ); @@ -81,8 +81,8 @@ int UtcDaliControlRendererSetGetDepthIndex(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "color-renderer"); - propertyMap.Insert("blend-color", Color::BLUE); + propertyMap.Insert("rendererType", "colorRenderer"); + propertyMap.Insert("blendColor", Color::BLUE); ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap ); controlRenderer.SetDepthIndex( 1.f ); @@ -147,16 +147,16 @@ int UtcDaliControlRendererSize(void) // gradient renderer Property::Map propertyMap; - propertyMap.Insert("renderer-type", "gradient-renderer"); + propertyMap.Insert("rendererType", "gradientRenderer"); Vector2 start(-1.f, -1.f); Vector2 end(1.f, 1.f); - propertyMap.Insert("gradient-start-position", start); - propertyMap.Insert("gradient-end-position", end); - propertyMap.Insert("gradient-stop-offset", Vector2(0.f, 1.f)); + propertyMap.Insert("gradientStartPosition", start); + propertyMap.Insert("gradientEndPosition", end); + propertyMap.Insert("gradientStopOffset", Vector2(0.f, 1.f)); Property::Array stopColors; stopColors.PushBack( Color::RED ); stopColors.PushBack( Color::GREEN ); - propertyMap.Insert("gradient-stop-color", stopColors); + propertyMap.Insert("gradientStopColor", stopColors); ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap); gradientRenderer.SetSize( rendererSize ); DALI_TEST_EQUALS( gradientRenderer.GetSize(), rendererSize, TEST_LOCATION ); @@ -173,8 +173,8 @@ int UtcDaliControlRendererSetOnOffStage(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "color-renderer"); - propertyMap.Insert("blend-color", Color::BLUE); + propertyMap.Insert("rendererType", "colorRenderer"); + propertyMap.Insert("blendColor", Color::BLUE); ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap ); Actor actor = Actor::New(); @@ -246,26 +246,27 @@ int UtcDaliControlRendererGetPropertyMap1(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "color-renderer"); - propertyMap.Insert("blend-color", Color::BLUE); + propertyMap.Insert("rendererType", "colorRenderer"); + propertyMap.Insert("blendColor", Color::BLUE); ControlRenderer colorRenderer = factory.GetControlRenderer( propertyMap ); Property::Map resultMap; colorRenderer.CreatePropertyMap( resultMap ); - Property::Value* typeValue = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( typeValue ); - DALI_TEST_CHECK( typeValue->Get() == "color-renderer" ); + DALI_TEST_CHECK( typeValue->Get() == "colorRenderer" ); - Property::Value* colorValue = resultMap.Find( "blend-color", Property::VECTOR4 ); + Property::Value* colorValue = resultMap.Find( "blendColor", Property::VECTOR4 ); DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::BLUE ); // change the blend color - factory.ResetRenderer( colorRenderer, Color::CYAN ); + Actor actor; + factory.ResetRenderer( colorRenderer, actor, Color::CYAN ); colorRenderer.CreatePropertyMap( resultMap ); - colorValue = resultMap.Find( "blend-color", Property::VECTOR4 ); + colorValue = resultMap.Find( "blendColor", Property::VECTOR4 ); DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::CYAN ); @@ -279,39 +280,39 @@ int UtcDaliControlRendererGetPropertyMap2(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "border-renderer"); - propertyMap.Insert("border-color", Color::BLUE); - propertyMap.Insert("border-size", 5.f); + propertyMap.Insert("rendererType", "borderRenderer"); + propertyMap.Insert("borderColor", Color::BLUE); + propertyMap.Insert("borderSize", 5.f); ControlRenderer borderRenderer = factory.GetControlRenderer( propertyMap ); Property::Map resultMap; borderRenderer.CreatePropertyMap( resultMap ); // check the property values from the returned map from control renderer - Property::Value* typeValue = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( typeValue ); - DALI_TEST_CHECK( typeValue->Get() == "border-renderer" ); + DALI_TEST_CHECK( typeValue->Get() == "borderRenderer" ); - Property::Value* colorValue = resultMap.Find( "border-color", Property::VECTOR4 ); + Property::Value* colorValue = resultMap.Find( "borderColor", Property::VECTOR4 ); DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::BLUE ); - Property::Value* sizeValue = resultMap.Find( "border-size", Property::FLOAT ); + Property::Value* sizeValue = resultMap.Find( "borderSize", Property::FLOAT ); DALI_TEST_CHECK( sizeValue ); DALI_TEST_CHECK( sizeValue->Get() == 5.f ); borderRenderer = factory.GetControlRenderer( 10.f, Color::CYAN ); borderRenderer.CreatePropertyMap( resultMap ); - typeValue = resultMap.Find( "renderer-type", Property::STRING ); + typeValue = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( typeValue ); - DALI_TEST_CHECK( typeValue->Get() == "border-renderer" ); + DALI_TEST_CHECK( typeValue->Get() == "borderRenderer" ); - colorValue = resultMap.Find( "border-color", Property::VECTOR4 ); + colorValue = resultMap.Find( "borderColor", Property::VECTOR4 ); DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::CYAN ); - colorValue = resultMap.Find( "border-size", Property::FLOAT ); + colorValue = resultMap.Find( "borderSize", Property::FLOAT ); DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == 10.f ); @@ -327,20 +328,20 @@ int UtcDaliControlRendererGetPropertyMap3(void) DALI_TEST_CHECK( factory ); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "gradient-renderer"); + propertyMap.Insert("rendererType", "gradientRenderer"); Vector2 start(-1.f, -1.f); Vector2 end(1.f, 1.f); - propertyMap.Insert("gradient-start-position", start); - propertyMap.Insert("gradient-end-position", end); - propertyMap.Insert("gradient-spread-method", "repeat"); + propertyMap.Insert("gradientStartPosition", start); + propertyMap.Insert("gradientEndPosition", end); + propertyMap.Insert("gradientSpreadMethod", "repeat"); - propertyMap.Insert("gradient-stop-offset", Vector2(0.2f, 0.8f)); + propertyMap.Insert("gradientStopOffset", Vector2(0.2f, 0.8f)); Property::Array stopColors; stopColors.PushBack( Color::RED ); stopColors.PushBack( Color::GREEN ); - propertyMap.Insert("gradient-stop-color", stopColors); + propertyMap.Insert("gradientStopColor", stopColors); ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap); @@ -348,34 +349,34 @@ int UtcDaliControlRendererGetPropertyMap3(void) gradientRenderer.CreatePropertyMap( resultMap ); // check the property values from the returned map from control renderer - Property::Value* value = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* value = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "gradient-renderer" ); + DALI_TEST_CHECK( value->Get() == "gradientRenderer" ); - value = resultMap.Find( "gradient-units", Property::STRING ); + value = resultMap.Find( "gradientUnits", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "object-bounding-box" ); + DALI_TEST_CHECK( value->Get() == "objectBoundingBox" ); - value = resultMap.Find( "gradient-spread-method", Property::STRING ); + value = resultMap.Find( "gradientSpreadMethod", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == "repeat" ); - value = resultMap.Find( "gradient-start-position", Property::VECTOR2 ); + value = resultMap.Find( "gradientStartPosition", Property::VECTOR2 ); DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), start , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-end-position", Property::VECTOR2 ); + value = resultMap.Find( "gradientEndPosition", Property::VECTOR2 ); DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), end , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-stop-offset", Property::ARRAY ); + value = resultMap.Find( "gradientStopOffset", Property::ARRAY ); DALI_TEST_CHECK( value ); Property::Array* offsetArray = value->GetArray(); DALI_TEST_CHECK( offsetArray->Count() == 2 ); DALI_TEST_EQUALS( offsetArray->GetElementAt(0).Get(), 0.2f , Math::MACHINE_EPSILON_100, TEST_LOCATION ); DALI_TEST_EQUALS( offsetArray->GetElementAt(1).Get(), 0.8f , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-stop-color", Property::ARRAY ); + value = resultMap.Find( "gradientStopColor", Property::ARRAY ); DALI_TEST_CHECK( value ); Property::Array* colorArray = value->GetArray(); DALI_TEST_CHECK( colorArray->Count() == 2 ); @@ -394,20 +395,20 @@ int UtcDaliControlRendererGetPropertyMap4(void) DALI_TEST_CHECK( factory ); Property::Map propertyMap; - propertyMap.Insert("renderer-type", "gradient-renderer"); + propertyMap.Insert("rendererType", "gradientRenderer"); Vector2 center(100.f, 100.f); float radius = 100.f; - propertyMap.Insert("gradient-units", "user-space"); - propertyMap.Insert("gradient-center", center); - propertyMap.Insert("gradient-radius", radius); - propertyMap.Insert("gradient-stop-offset", Vector3(0.1f, 0.3f, 1.1f)); + propertyMap.Insert("gradientUnits", "userSpace"); + propertyMap.Insert("gradientCenter", center); + propertyMap.Insert("gradientRadius", radius); + propertyMap.Insert("gradientStopOffset", Vector3(0.1f, 0.3f, 1.1f)); Property::Array stopColors; stopColors.PushBack( Color::RED ); stopColors.PushBack( Color::BLACK ); stopColors.PushBack( Color::GREEN ); - propertyMap.Insert("gradient-stop-color", stopColors); + propertyMap.Insert("gradientStopColor", stopColors); ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap); DALI_TEST_CHECK( gradientRenderer ); @@ -416,27 +417,27 @@ int UtcDaliControlRendererGetPropertyMap4(void) gradientRenderer.CreatePropertyMap( resultMap ); // check the property values from the returned map from control renderer - Property::Value* value = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* value = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "gradient-renderer" ); + DALI_TEST_CHECK( value->Get() == "gradientRenderer" ); - value = resultMap.Find( "gradient-units", Property::STRING ); + value = resultMap.Find( "gradientUnits", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "user-space" ); + DALI_TEST_CHECK( value->Get() == "userSpace" ); - value = resultMap.Find( "gradient-spread-method", Property::STRING ); + value = resultMap.Find( "gradientSpreadMethod", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == "pad" ); - value = resultMap.Find( "gradient-center", Property::VECTOR2 ); + value = resultMap.Find( "gradientCenter", Property::VECTOR2 ); DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), center , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-radius", Property::FLOAT ); + value = resultMap.Find( "gradientRadius", Property::FLOAT ); DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), radius , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-stop-offset", Property::ARRAY ); + value = resultMap.Find( "gradientStopOffset", Property::ARRAY ); DALI_TEST_CHECK( value ); Property::Array* offsetArray = value->GetArray(); DALI_TEST_CHECK( offsetArray->Count() == 3 ); @@ -445,7 +446,7 @@ int UtcDaliControlRendererGetPropertyMap4(void) // any stop value will be clamped to [0.0, 1.0]; DALI_TEST_EQUALS( offsetArray->GetElementAt(2).Get(), 1.0f , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - value = resultMap.Find( "gradient-stop-color", Property::ARRAY ); + value = resultMap.Find( "gradientStopColor", Property::ARRAY ); DALI_TEST_CHECK( value ); Property::Array* colorArray = value->GetArray(); DALI_TEST_CHECK( colorArray->Count() == 3 ); @@ -463,12 +464,12 @@ int UtcDaliControlRendererGetPropertyMap5(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert( "renderer-type", "image-renderer" ); - propertyMap.Insert( "image-url", TEST_IMAGE_FILE_NAME ); - propertyMap.Insert( "image-desired-width", 20 ); - propertyMap.Insert( "image-desired-height", 30 ); - propertyMap.Insert( "image-fitting-mode", "fit-height" ); - propertyMap.Insert( "image-sampling-mode", "box-then-nearest" ); + propertyMap.Insert( "rendererType", "imageRenderer" ); + propertyMap.Insert( "imageUrl", TEST_IMAGE_FILE_NAME ); + propertyMap.Insert( "imageDesiredWidth", 20 ); + propertyMap.Insert( "imageDesiredHeight", 30 ); + propertyMap.Insert( "imageFittingMode", "fitHeight" ); + propertyMap.Insert( "imageSamplingMode", "boxThenNearest" ); ControlRenderer imageRenderer = factory.GetControlRenderer(propertyMap); DALI_TEST_CHECK( imageRenderer ); @@ -477,27 +478,27 @@ int UtcDaliControlRendererGetPropertyMap5(void) imageRenderer.CreatePropertyMap( resultMap ); // check the property values from the returned map from control renderer - Property::Value* value = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* value = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "image-renderer" ); + DALI_TEST_CHECK( value->Get() == "imageRenderer" ); - value = resultMap.Find( "image-url", Property::STRING ); + value = resultMap.Find( "imageUrl", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == TEST_IMAGE_FILE_NAME ); - value = resultMap.Find( "image-fitting-mode", Property::STRING ); + value = resultMap.Find( "imageFittingMode", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "fit-height" ); + DALI_TEST_CHECK( value->Get() == "fitHeight" ); - value = resultMap.Find( "image-sampling-mode", Property::STRING ); + value = resultMap.Find( "imageSamplingMode", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "box-then-nearest" ); + DALI_TEST_CHECK( value->Get() == "boxThenNearest" ); - value = resultMap.Find( "image-desired-width", Property::INTEGER ); + value = resultMap.Find( "imageDesiredWidth", Property::INTEGER ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 20 ); - value = resultMap.Find( "image-desired-height", Property::INTEGER ); + value = resultMap.Find( "imageDesiredHeight", Property::INTEGER ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 30 ); @@ -506,27 +507,27 @@ int UtcDaliControlRendererGetPropertyMap5(void) imageRenderer = factory.GetControlRenderer(image); imageRenderer.CreatePropertyMap( resultMap ); - value = resultMap.Find( "renderer-type", Property::STRING ); + value = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "image-renderer" ); + DALI_TEST_CHECK( value->Get() == "imageRenderer" ); - value = resultMap.Find( "image-url", Property::STRING ); + value = resultMap.Find( "imageUrl", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == TEST_IMAGE_FILE_NAME ); - value = resultMap.Find( "image-fitting-mode", Property::STRING ); + value = resultMap.Find( "imageFittingMode", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "shrink-to-fit" ); + DALI_TEST_CHECK( value->Get() == "shrinkToFit" ); - value = resultMap.Find( "image-sampling-mode", Property::STRING ); + value = resultMap.Find( "imageSamplingMode", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == "box" ); - value = resultMap.Find( "image-desired-width", Property::INTEGER ); + value = resultMap.Find( "imageDesiredWidth", Property::INTEGER ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 100 ); - value = resultMap.Find( "image-desired-height", Property::INTEGER ); + value = resultMap.Find( "imageDesiredHeight", Property::INTEGER ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 200 ); @@ -540,24 +541,24 @@ int UtcDaliControlRendererGetPropertyMap6(void) RendererFactory factory = RendererFactory::Get(); Property::Map propertyMap; - propertyMap.Insert( "renderer-type", "n-patch-renderer" ); - propertyMap.Insert( "image-url", TEST_NPATCH_FILE_NAME ); - propertyMap.Insert( "border-only", true ); + propertyMap.Insert( "rendererType", "nPatchRenderer" ); + propertyMap.Insert( "imageUrl", TEST_NPATCH_FILE_NAME ); + propertyMap.Insert( "borderOnly", true ); ControlRenderer nPatchRenderer = factory.GetControlRenderer( propertyMap ); Property::Map resultMap; nPatchRenderer.CreatePropertyMap( resultMap ); // check the property values from the returned map from control renderer - Property::Value* value = resultMap.Find( "renderer-type", Property::STRING ); + Property::Value* value = resultMap.Find( "rendererType", Property::STRING ); DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == "n-patch-renderer" ); + DALI_TEST_CHECK( value->Get() == "nPatchRenderer" ); - value = resultMap.Find( "image-url", Property::STRING ); + value = resultMap.Find( "imageUrl", Property::STRING ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == TEST_NPATCH_FILE_NAME ); - value = resultMap.Find( "border-only", Property::BOOLEAN ); + value = resultMap.Find( "borderOnly", Property::BOOLEAN ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() );