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-Alignment.cpp;h=bffde5d6a64f49c7711c7742cfc12530f748bd8f;hp=4dcef6888e22da762726d8d9974192d06549e510;hb=75fdb5f9730fa6f6723c517691c9778fb646d082;hpb=2ec164cd618f93ccafe17b1d0b8ff16401ed4aef diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp index 4dcef68..bffde5d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -39,9 +39,14 @@ void utc_dali_toolkit_alignment_cleanup(void) test_return_value = TET_PASS; } - namespace { +/// Compare an int (Or'd Alignment::Type) with an Alignment::Type value +void DALI_TEST_EQUALS( int value1, Alignment::Type value2, const char* location ) +{ + ::DALI_TEST_EQUALS< Alignment::Type >( static_cast< Alignment::Type >( value1 ), value2, location ); +} + static bool gObjectCreatedCallBackCalled; static void TestCallback(BaseHandle handle) @@ -232,7 +237,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // Default, HorizontalCenter, VerticalCenter - Ensure they do not change! { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -252,7 +257,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalLeft, VerticalCenter { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -272,7 +277,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalRight, VerticalCenter { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -292,7 +297,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalLeft, VerticalTop { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -312,7 +317,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalCenter, VerticalTop { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -332,7 +337,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalRight, VerticalTop { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -352,7 +357,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalLeft, VerticalBottom { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -372,7 +377,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalCenter, VerticalBottom { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -392,7 +397,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) // HorizontalRight, VerticalBottom { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -466,7 +471,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(); DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -479,7 +484,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalLeft); DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -492,7 +497,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalRight); DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -505,7 +510,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop); DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -518,7 +523,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop); DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -531,7 +536,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop); DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -544,7 +549,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom); DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -557,7 +562,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom); DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -570,7 +575,7 @@ int UtcDaliAlignmentGetAlignmentType(void) { Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom); DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -588,7 +593,7 @@ int UtcDaliAlignmentSetScaling(void) // ScaleToFill { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -621,7 +626,7 @@ int UtcDaliAlignmentSetScaling(void) // ScaleToFitKeepAspect { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -654,7 +659,7 @@ int UtcDaliAlignmentSetScaling(void) // ScaleToFillKeepAspect { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -687,7 +692,7 @@ int UtcDaliAlignmentSetScaling(void) // ShrinkToFit { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -720,7 +725,7 @@ int UtcDaliAlignmentSetScaling(void) // ShrinkToFitKeepAspect { Alignment alignment = Alignment::New(); - alignment.Add(RenderableActor::New()); + alignment.Add(Actor::New()); Stage::GetCurrent().Add(alignment); application.Render(); application.SendNotification(); @@ -905,7 +910,7 @@ int UtcDaliAlignmentChildAddAndRemove(void) application.Render(); application.SendNotification(); - Actor actor = RenderableActor::New(); + Actor actor = Actor::New(); alignment.Add(actor); DALI_TEST_EQUALS(alignment.GetChildCount(), 1u, TEST_LOCATION); @@ -924,7 +929,7 @@ int UtcDaliAlignmentChildAddAndRemove(void) END_TEST; } -int UtcDaliAlignmentOnSizeSet(void) +int UtcDaliAlignmentSizeSetP(void) { ToolkitTestApplication application; @@ -935,14 +940,14 @@ int UtcDaliAlignmentOnSizeSet(void) application.SendNotification(); Vector2 size( 100.0f, 200.0f ); - alignment.SetPreferredSize(size); + alignment.SetSize(size); application.Render(); application.SendNotification(); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS(size, alignment.GetImplementation().GetControlSize().GetVectorXY(), TEST_LOCATION); + DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION); Stage::GetCurrent().Remove(alignment); END_TEST; @@ -1010,7 +1015,7 @@ int UtcDaliAlignmentOnSizeAnimation(void) Stage::GetCurrent().Add(alignment); Animation animation = Animation::New(100.0f); - animation.Resize(alignment, Vector3(100.0f, 150.0f, 200.0f)); + animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) ); animation.Play(); application.Render();