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-Control.cpp;h=d10cbeceb04a5135086689fc920626c1c1ed21be;hp=c08e3603d54168ac81f89b9165afa69f615a35dd;hb=refs%2Fchanges%2F77%2F239777%2F2;hpb=e9e0a004027846f001ca87c1db13c811177c8f70 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp index c08e360..d10cbec 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp @@ -181,6 +181,43 @@ int UtcDaliControlCopyAndAssignment(void) END_TEST; } +int UtcDaliControlMoveConstructor(void) +{ + ToolkitTestApplication application; + + Control control = Control::New(); + DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + control.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Control moved = std::move( control ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !control ); + + END_TEST; +} + +int UtcDaliControlMoveAssignment(void) +{ + ToolkitTestApplication application; + + Control control = Control::New(); + DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + control.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Control moved; + moved = std::move( control ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !control ); + + END_TEST; +} + int UtcDaliControlDownCast(void) { ToolkitTestApplication application; @@ -512,6 +549,18 @@ int UtcDaliControlBackgroundColorRendererCount(void) DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION ); DALI_TEST_EQUALS( GetControlBackgroundColor( control ), semiTransparent, TEST_LOCATION ); + Renderer renderer = control.GetRendererAt( 0 ); + DALI_TEST_CHECK( renderer ); + + tet_infoline( "Set semi transparent alpha with positive RGB values, renderer should not be changed" ); + const Vector4 newColor( 1.0f, 1.0f, 0.5f, 0.5f ); + control.SetBackgroundColor( newColor ); + application.SendNotification(); + application.Render(); + DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS( GetControlBackgroundColor( control ), newColor, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer, control.GetRendererAt( 0 ), TEST_LOCATION ); + tet_infoline( "Set transparent, ensure no renderers are created" ); control.SetBackgroundColor( Color::TRANSPARENT ); application.SendNotification();