From 297f07d401e8987a50b0a982fd9603f60dc19fa6 Mon Sep 17 00:00:00 2001 From: Jahangir Date: Fri, 1 Jul 2016 16:58:57 -0400 Subject: [PATCH] [ITC][dali-core][Non-ACR][Added and modofied TC] Change-Id: I6c273592f75d5405a88959681219c0a7a3ef1062 --- src/itc/dali-core/actor/ITs-actor-impl.h | 104 +++++++++++++++++++++ src/itc/dali-core/actor/ITs-actor.cpp | 37 +++++++- src/itc/dali-core/any/ITs-any.cpp | 36 ++++--- src/itc/dali-core/layer/ITs-layer-impl.h | 90 +++++++++--------- src/itc/dali-core/ref-object/ITs-refobject.cpp | 26 +++--- src/itc/dali-core/stage/ITs-stage-impl.h | 15 +++ src/itc/dali-core/stage/ITs-stage.cpp | 4 +- .../dali-core/tct-dali-core-native_common_iot.h | 2 + src/itc/dali-core/tct-dali-core-native_mobile.h | 2 + src/itc/dali-core/tct-dali-core-native_tv.h | 2 + src/itc/dali-core/tct-dali-core-native_wearable.h | 2 + 11 files changed, 251 insertions(+), 69 deletions(-) diff --git a/src/itc/dali-core/actor/ITs-actor-impl.h b/src/itc/dali-core/actor/ITs-actor-impl.h index 1b7501f..bd4fe8c 100755 --- a/src/itc/dali-core/actor/ITs-actor-impl.h +++ b/src/itc/dali-core/actor/ITs-actor-impl.h @@ -1,4 +1,6 @@ #include "ITs-actor-common.h" +#include +#include extern int gArgc; extern char ** gArgv; @@ -2237,6 +2239,108 @@ void VTActorSetInheritPosition003() DALI_CHECK_FAIL( g_child.GetCurrentWorldPosition() != g_parentPosition + g_childOffset, "Current world position not match" ); DaliLog::PrintPass(); } + /* Build tree of actors: + * + * Depth + * + * A (parent) 1 + * / \ + * B C 2 + * / \ \ + * D E F 3 + * + * GetHierarchyDepth should return 1 for A, 2 for B and C, and 3 for D, E and F. + */ +void ActorGetHierarchyDepthAddRemoveRendererScreenToLocal() +{ + OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__) + + //Leave Required test + Actor actor = Actor::New(); + actor.SetLeaveRequired(false); + DALI_CHECK_FAIL(actor.GetLeaveRequired() != false , "Set and Get mismatch for Leave Required"); + + //renderer test + DALI_CHECK_FAIL( actor.GetRendererCount() != 0u, "Actor get renderer count mismatch"); + Geometry geometry = Geometry::QUAD(); + Shader shader = Shader::New( "vertexSrc", "fragmentSrc" ); + Renderer renderer = Renderer::New(geometry, shader); + Renderer renderer1 = Renderer::New(geometry, shader); + DALI_CHECK_FAIL( !renderer, "Renderer::New(geometry, shader) is failed"); + DALI_CHECK_FAIL( !renderer1, "Renderer::New(geometry, shader) is failed"); + actor.AddRenderer( renderer ); + actor.AddRenderer( renderer1 ); + DALI_CHECK_FAIL( actor.GetRendererCount() !=2u, "Actor get renderer count mismatch" ); + DALI_CHECK_FAIL( actor.GetRendererAt(0) != renderer, "Actor get renderer count mismatch" ); + actor.RemoveRenderer(0); + DALI_CHECK_FAIL( actor.GetRendererCount() !=1u, "Actor get renderer count mismatch" ); + actor.RemoveRenderer(renderer1); + DALI_CHECK_FAIL( actor.GetRendererCount() !=0u, "Actor get renderer count mismatch" ); + + //screen to local test + float localX; + float localY; + Actor actor1 = Actor::New(); + actor1.SetAnchorPoint(AnchorPoint::TOP_LEFT); + actor1.SetSize(100.0f, 100.0f); + actor1.SetPosition(10.0f, 10.0f); + Stage::GetCurrent().Add(actor1); + DALI_CHECK_FAIL( actor1.ScreenToLocal(localX, localY, 50.0f, 50.0f) , "screenToLocal is failed"); + + //Get Hierarchy Depth test + Actor actorA = Actor::New(); + Actor actorB = Actor::New(); + Actor actorC = Actor::New(); + Actor actorD = Actor::New(); + Actor actorE = Actor::New(); + Actor actorF = Actor::New(); + + //Test that root actor has depth equal 0 + DALI_CHECK_FAIL( 0 != Stage::GetCurrent().GetRootLayer().GetHierarchyDepth(), "" ); + + //Test actors return depth -1 when not connected to the tree + DALI_CHECK_FAIL( -1 != actorA.GetHierarchyDepth(), "Default failed" ); + DALI_CHECK_FAIL( -1 != actorB.GetHierarchyDepth(), "Default failed" ); + DALI_CHECK_FAIL( -1 != actorC.GetHierarchyDepth(), "Default failed" ); + DALI_CHECK_FAIL( -1 != actorD.GetHierarchyDepth(), "Default failed" ); + DALI_CHECK_FAIL( -1 != actorE.GetHierarchyDepth(), "Default failed" ); + DALI_CHECK_FAIL( -1 != actorF.GetHierarchyDepth(), "Default failed" ); + + //Create the hierarchy + Stage::GetCurrent().Add( actorA ); + actorA.Add( actorB ); + actorA.Add( actorC ); + actorB.Add( actorD ); + actorB.Add( actorE ); + actorC.Add( actorF ); + + //Test actors return correct depth + DALI_CHECK_FAIL( 1 != actorA.GetHierarchyDepth(), "Failed to add" ); + DALI_CHECK_FAIL( 2 != actorB.GetHierarchyDepth(), "Failed to add" ); + DALI_CHECK_FAIL( 2 != actorC.GetHierarchyDepth(), "Failed to add" ); + DALI_CHECK_FAIL( 3 != actorD.GetHierarchyDepth(), "Failed to add" ); + DALI_CHECK_FAIL( 3 != actorE.GetHierarchyDepth(), "Failed to add" ); + DALI_CHECK_FAIL( 3 != actorF.GetHierarchyDepth(), "Failed to add" ); + + //Removing actorB from the hierarchy. actorB, actorD and actorE should now have depth equal -1 + actorA.Remove( actorB ); + + DALI_CHECK_FAIL( -1 != actorB.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorD.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorE.GetHierarchyDepth(), "Failed to remove" ); + + //Removing actorA from the stage. All actors should have depth equal -1 + Stage::GetCurrent().Remove( actorA ); + + DALI_CHECK_FAIL( -1 != actorA.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorB.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorC.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorD.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorE.GetHierarchyDepth(), "Failed to remove" ); + DALI_CHECK_FAIL( -1 != actorF.GetHierarchyDepth(), "Failed to remove" ); + + DaliLog::PrintPass(); +} /** diff --git a/src/itc/dali-core/actor/ITs-actor.cpp b/src/itc/dali-core/actor/ITs-actor.cpp index 701a305..fc0b629 100755 --- a/src/itc/dali-core/actor/ITs-actor.cpp +++ b/src/itc/dali-core/actor/ITs-actor.cpp @@ -90,7 +90,8 @@ namespace ACTOR_INSERT_ROTATE_BY_RADIAN_QUENTERION, ACTOR_GET_NATURAL_SIZE_RESIZE_POLICY, ACTOR_ASSIGNMENT_OPERATOR_GET_RELAYOUT_SIZE, - ACTOR_SET_INHERIT_POSITION + ACTOR_SET_INHERIT_POSITION, + ACTOR_GET_HIERARCHY_DEPTH_ADD_REMOVE_RENDERER_SCREEN_TO_LOCAL }; struct Actor_TestApp : public ConnectionTracker @@ -382,6 +383,10 @@ namespace case ACTOR_SET_INHERIT_POSITION: ActorSetInheritPosition(); break; + + case ACTOR_GET_HIERARCHY_DEPTH_ADD_REMOVE_RENDERER_SCREEN_TO_LOCAL: + ActorGetHierarchyDepthAddRemoveRendererScreenToLocal(); + break; } } @@ -2627,6 +2632,36 @@ int ITcActorSetInheritPosition(void) application.MainLoop(); return test_return_value; } + +//& purpose: To Get Hierarchy Depth of actor +//& type: auto +/** +* @testcase ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal +* @type Positive +* @since_tizen 3.0 +* @description To set/get the actor inherit position +* @scenario Create initialized Actor and create actor from another actor \n +* Add Actor to stage and actor to actor\n +* Get Actor Get Hierarchy Depth\n +* Check the Set/Get LeaveRequired \n +* Check add remove renderer \n +* Check Screen to local. +* @apicovered Actor::New(),Actor::GetHierarchyDepth(), Stage::GetCurrent().GetRootLayer().GetHierarchyDepth(), Actor::SetLeaveRequired() +* @passcase If Get Hierarchy Depth value are correct +* @failcase If Get Hierarchy Depth value are not correct +* @precondition NA +* @postcondition NA +*/ + +int ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal(void) +{ + DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__); + Application application = Application::New( &gArgc, &gArgv ); + Actor_TestApp testApp( application, ACTOR_GET_HIERARCHY_DEPTH_ADD_REMOVE_RENDERER_SCREEN_TO_LOCAL); + application.MainLoop(); + return test_return_value; +} + /** @} */ //end of dali-core-Actor-testcases /** @} */ //end of dali-core-Actor /** @} */ //end of dali-core diff --git a/src/itc/dali-core/any/ITs-any.cpp b/src/itc/dali-core/any/ITs-any.cpp index 5b77beb..e8bf121 100755 --- a/src/itc/dali-core/any/ITs-any.cpp +++ b/src/itc/dali-core/any/ITs-any.cpp @@ -290,19 +290,33 @@ void AnyCopyConstructor() } void AnyGetTypeAnyCast() -{ +{ OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__) Any any; - DALI_CHECK_FAIL( typeid( void ) != any.GetType() , " Any::GetType is failed to get correct type."); - any = 50.0f; - DALI_CHECK_FAIL( typeid( float ) != any.GetType() , " Any::GetType is failed to get correct type."); - any = 5; - DALI_CHECK_FAIL( typeid( int ) != any.GetType() , " Any::GetType is failed to get correct type."); - - Any intvariable= 1; - AnyCast< int >( intvariable ); - DALI_CHECK_FAIL( typeid( int ) != intvariable.GetType() , " Any::Anycast is failed"); - + DALI_CHECK_FAIL( typeid( void ) != any.GetType() , " Any::GetType is failed to get correct type."); + any = 50.0f; + DALI_CHECK_FAIL( typeid( float ) != any.GetType() , " Any::GetType is failed to get correct type."); + any = 5; + DALI_CHECK_FAIL( typeid( int ) != any.GetType() , " Any::GetType is failed to get correct type."); + + Any intvariable= 1; + AnyCast< int >( intvariable ); + DALI_CHECK_FAIL( typeid( int ) != intvariable.GetType() , " Any::Anycast is failed"); + + Dali::Any myAny; + float* f = myAny.GetPointer(); + DALI_CHECK_FAIL(f != NULL, "GetPointer is failed"); + + Dali::Any myAny1(1.1f); + const float* f1=myAny1.GetPointer(); + DALI_CHECK_FAIL(f1 == NULL, "GetPointer is failed"); + + myAny=1.2f; + f=myAny.GetPointer(); + *f=2.2f; + float value=myAny.Get(); + DALI_CHECK_FAIL(value != 2.2f, "GetPointer is failed"); + DaliLog::PrintPass(); } diff --git a/src/itc/dali-core/layer/ITs-layer-impl.h b/src/itc/dali-core/layer/ITs-layer-impl.h index 22011cc..0f33fd4 100755 --- a/src/itc/dali-core/layer/ITs-layer-impl.h +++ b/src/itc/dali-core/layer/ITs-layer-impl.h @@ -41,32 +41,32 @@ void LayerIsHoverConsumedAfterSetHoverConsumed(void) bool bIsHoverConsumed = true; Layer layer = Layer::New(); - DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); - Stage::GetCurrent().Add(layer); + DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); + Stage::GetCurrent().Add(layer); layer.SetHoverConsumed(bIsHoverConsumed); DALI_CHECK_FAIL(layer.IsHoverConsumed() != bIsHoverConsumed, "Layer::IsHoverConsumed() is failed. mismatches with the previously set value by Layer::SetHoverConsumed()." ); bIsHoverConsumed = false; layer.SetHoverConsumed(bIsHoverConsumed); DALI_CHECK_FAIL(layer.IsHoverConsumed() != bIsHoverConsumed, "Layer::IsHoverConsumed() is failed. mismatches with the previously set value by Layer::SetHoverConsumed()." ); - Stage::GetCurrent().Remove(layer); - DaliLog::PrintPass(); + Stage::GetCurrent().Remove(layer); + DaliLog::PrintPass(); } void LayerIsTouchConsumedAfterSetTouchConsumed(void) { OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__) bool bIsTouchConsumed = true; Layer layer = Layer::New(); - DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); + DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); Stage::GetCurrent().Add(layer); layer.SetTouchConsumed(bIsTouchConsumed); DALI_CHECK_FAIL(layer.IsTouchConsumed() != bIsTouchConsumed, "Layer::IsTouchConsumed() is failed. mismatches with the previously set value by Layer::SetTouchConsumed()." ); bIsTouchConsumed = false; - layer.SetTouchConsumed(bIsTouchConsumed); + layer.SetTouchConsumed(bIsTouchConsumed); DALI_CHECK_FAIL(layer.IsTouchConsumed() != bIsTouchConsumed, "Layer::IsTouchConsumed() is failed. mismatches with the previously set value by Layer::SetTouchConsumed()." ); - Stage::GetCurrent().Remove(layer); + Stage::GetCurrent().Remove(layer); DaliLog::PrintPass(); } void LayerDownCastBaseHandle(void) @@ -76,27 +76,33 @@ void LayerDownCastBaseHandle(void) DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); Stage::GetCurrent().Add(layer); - BaseHandle object(layer); + BaseHandle object(layer); Layer layer2 = Layer::DownCast(object); - DALI_CHECK_FAIL(!layer2, "Layer::DownCast is failed." ); + DALI_CHECK_FAIL(!layer2, "Layer::DownCast is failed." ); Stage::GetCurrent().Remove(layer); - DaliLog::PrintPass(); + DaliLog::PrintPass(); } void LayerDownCast(void) { OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__) Layer layer = Layer::New(); - DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); - Stage::GetCurrent().Add(layer); + DALI_CHECK_FAIL(!layer, "Layer::New() is failed." ); + Stage::GetCurrent().Add(layer); Actor actor = Actor::New(); DALI_CHECK_FAIL(!actor, "Actor::New() is failed." ); + Layer layer1 = Layer::New(); + + DALI_CHECK_FAIL( layer1.GetBehavior() != Dali::Layer::LAYER_2D, "Layer Behavior Mismatch" ); + layer1.SetBehavior( Dali::Layer::LAYER_3D ); + DALI_CHECK_FAIL( layer1.GetBehavior() != Dali::Layer::LAYER_3D, "Layer Behavior Mismatch" ); + actor.Add(layer); Actor childActor = actor.GetChildAt(0); Layer layer2 = DownCast< Layer >(childActor); - DALI_CHECK_FAIL(!layer2, "Layer::DownCast is failed" ); + DALI_CHECK_FAIL(!layer2, "Layer::DownCast is failed" ); Stage::GetCurrent().Remove(layer); DaliLog::PrintPass(); @@ -107,9 +113,9 @@ void LayerGetDepth(void) unsigned int unGetDepth = 11u; Layer layer1 = Layer::New(); - DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); + DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); Layer layer2 = Layer::New(); - DALI_CHECK_FAIL(!layer2, "Layer::New() is failed" ); + DALI_CHECK_FAIL(!layer2, "Layer::New() is failed" ); Layer rootLayer = Stage::GetCurrent().GetLayer( 0 ); Stage::GetCurrent().Add(layer1); @@ -146,9 +152,9 @@ void LayerGetDepth(void) Stage::GetCurrent().Remove(layer1); unGetDepth = layer2.GetDepth(); - DALI_CHECK_FAIL(unGetDepth != 1u, "unGetDepth should be 1u but it is:"); + DALI_CHECK_FAIL(unGetDepth != 1u, "unGetDepth should be 1u but it is:"); - Stage::GetCurrent().Remove(layer2); + Stage::GetCurrent().Remove(layer2); DaliLog::PrintPass(); } void LayerLowerBelowToBottom(void) @@ -157,7 +163,7 @@ void LayerLowerBelowToBottom(void) unsigned int unGetDepth = 11u; Layer layer1 = Layer::New(); - DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); + DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); Layer layer2 = Layer::New(); DALI_CHECK_FAIL(!layer2, "Layer::New() is failed" ); @@ -192,7 +198,7 @@ void LayerLowerBelowToBottom(void) unGetDepth = layer2.GetDepth(); if (unGetDepth != 1u) { - LOG_E("unGetDepth should be 1u but it is:"); + LOG_E("unGetDepth should be 1u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -211,7 +217,7 @@ void LayerLowerBelowToBottom(void) unGetDepth = layer1.GetDepth(); if (unGetDepth != 1u) { - LOG_E("unGetDepth should be 1u but it is:"); + LOG_E("unGetDepth should be 1u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -221,7 +227,7 @@ void LayerLowerBelowToBottom(void) unGetDepth = layer2.GetDepth(); if (unGetDepth != 2u) { - LOG_E("unGetDepth should be 2u but it is:"); + LOG_E("unGetDepth should be 2u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -233,7 +239,7 @@ void LayerLowerBelowToBottom(void) unGetDepth = layer2.GetDepth(); if (unGetDepth != 0u) { - LOG_E("unGetDepth should be 0u but it is:"); + LOG_E("unGetDepth should be 0u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -251,10 +257,10 @@ void LayerLowerBelowToBottom(void) } unGetDepth = layer1.GetDepth(); - DALI_CHECK_FAIL(unGetDepth != 2u, "unGetDepth should be 2u but it is:"); + DALI_CHECK_FAIL(unGetDepth != 2u, "unGetDepth should be 2u but it is:"); - Stage::GetCurrent().Remove(layer1); - Stage::GetCurrent().Remove(layer2); + Stage::GetCurrent().Remove(layer1); + Stage::GetCurrent().Remove(layer2); DaliLog::PrintPass(); } @@ -264,7 +270,7 @@ void LayerMoveAboveBelow(void) unsigned int unGetDepth = 11u; Layer layer1 = Layer::New(); - DALI_CHECK_FAIL(!layer1, "Layer::New() is failed " ); + DALI_CHECK_FAIL(!layer1, "Layer::New() is failed " ); Layer layer2 = Layer::New(); DALI_CHECK_FAIL(!layer2, "Layer::New() is failed " ); @@ -296,12 +302,12 @@ void LayerMoveAboveBelow(void) return; } - layer1.MoveAbove(layer2); + layer1.MoveAbove(layer2); unGetDepth = layer1.GetDepth(); if (unGetDepth != 2u) { - LOG_E("unGetDepth should be 2u but it is:"); + LOG_E("unGetDepth should be 2u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -332,7 +338,7 @@ void LayerMoveAboveBelow(void) unGetDepth = rootLayer.GetDepth(); if (unGetDepth != 1u) { - LOG_E("unGetDepth should be 1u but it is:"); + LOG_E("unGetDepth should be 1u but it is:"); Stage::GetCurrent().Remove(layer1); Stage::GetCurrent().Remove(layer2); test_return_value=1; @@ -340,19 +346,19 @@ void LayerMoveAboveBelow(void) } unGetDepth = layer1.GetDepth(); - DALI_CHECK_FAIL(unGetDepth != 2u, "unGetDepth should be 2u but it is:"); + DALI_CHECK_FAIL(unGetDepth != 2u, "unGetDepth should be 2u but it is:"); - Stage::GetCurrent().Remove(layer1); - Stage::GetCurrent().Remove(layer2); + Stage::GetCurrent().Remove(layer1); + Stage::GetCurrent().Remove(layer2); DaliLog::PrintPass(); } void LayerRaiseAboveToTop(void) { OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__) - unsigned int unGetDepth = 11u; + unsigned int unGetDepth = 11u; Layer layer1 = Layer::New(); - DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); + DALI_CHECK_FAIL(!layer1, "Layer::New() is failed" ); Layer layer2 = Layer::New(); DALI_CHECK_FAIL(!layer2, "Layer::New() is failed" ); @@ -361,7 +367,7 @@ void LayerRaiseAboveToTop(void) DALI_CHECK_FAIL(unGetDepth != 0u, "unGetDepth should be 0u but it is"); Stage::GetCurrent().Add(layer1); - Stage::GetCurrent().Add(layer2); + Stage::GetCurrent().Add(layer2); unGetDepth = layer1.GetDepth(); if (unGetDepth != 1u) { @@ -474,10 +480,10 @@ void LayerSetGetClippingBox(void) ClippingBox clipTestBox(nX,nY,nHeight,nWidth); layer.SetClippingBox(clipTestBox); clipGetTestBox = layer.GetClippingBox(); - DALI_CHECK_FAIL(clipGetTestBox != clipTestBox, "The set and get value is not matched" ); + DALI_CHECK_FAIL(clipGetTestBox != clipTestBox, "The set and get value is not matched" ); Stage::GetCurrent().Remove(layer); - DaliLog::PrintPass(); + DaliLog::PrintPass(); } void LayerSetIsDepthTestDisabled(void) { @@ -491,7 +497,7 @@ void LayerSetIsDepthTestDisabled(void) layer.SetDepthTestDisabled(bSetTestDisable); bIsDepthTest = layer.IsDepthTestDisabled(); - DALI_CHECK_FAIL(bSetTestDisable!=bIsDepthTest, "IsDepthTestDisabled should be true but it is false" ); + DALI_CHECK_FAIL(bSetTestDisable!=bIsDepthTest, "IsDepthTestDisabled should be true but it is false" ); Stage::GetCurrent().Remove(layer); @@ -533,17 +539,17 @@ void LayerSetSortFunction(void) g_bLayerTestSortFunctionCalled = false; Stage::GetCurrent().Add( g_imgViewOne_l ); - Stage::GetCurrent().Add( g_imgViewOne_l ); - Layer root = Stage::GetCurrent().GetLayer( 0 ); + Stage::GetCurrent().Add( g_imgViewOne_l ); + Layer root = Stage::GetCurrent().GetLayer( 0 ); root.SetSortFunction( LayerTestSortFunction ); } void VTLayerSetSortFunction001(void) { - DALI_CHECK_FAIL(!g_bLayerTestSortFunctionCalled, "SetSortFunction is not called." ); + DALI_CHECK_FAIL(!g_bLayerTestSortFunctionCalled, "SetSortFunction is not called." ); Stage::GetCurrent().Remove(g_imgViewOne_l); - Stage::GetCurrent().Remove(g_imgViewTwo_l); + Stage::GetCurrent().Remove(g_imgViewTwo_l); DaliLog::PrintPass(); } diff --git a/src/itc/dali-core/ref-object/ITs-refobject.cpp b/src/itc/dali-core/ref-object/ITs-refobject.cpp index 9faa107..f880b87 100755 --- a/src/itc/dali-core/ref-object/ITs-refobject.cpp +++ b/src/itc/dali-core/ref-object/ITs-refobject.cpp @@ -61,7 +61,7 @@ namespace bool Tick() { mTimer.Stop(); - mApplication.Quit(); + mApplication.Quit(); return true; } @@ -104,22 +104,20 @@ namespace RefObject *pRefobject = NULL, *pRefobject2 = NULL; DALI_CHECK_FAIL(!RefObjInit(stage,actor,&vec3SetPosition), "Initialization failed" ); - - BaseHandle BaseRefobject = actor; + + BaseHandle BaseRefobject = actor; DALI_CHECK_FAIL(!BaseRefobject, "BaseHandle is not created" ); pRefobject = BaseRefobject.GetObjectPtr(); DALI_CHECK_FAIL(pRefobject == NULL, "Reference is NULL after assigning basehandle to it" ); pRefobject2 = pRefobject; - DALI_CHECK_FAIL(pRefobject2 == NULL, "Reference is NULL after assigning a constant reference object to it" ); - nCount = pRefobject->ReferenceCount(); - nCount1 = BaseRefobject.GetBaseObject().ReferenceCount(); - DALI_CHECK_FAIL(nCount != nCount1, "Getting Reference Count mismatched"); + RefObject *pRefobjectCopy(pRefobject); + DALI_CHECK_FAIL(pRefobjectCopy != pRefobject, "RefObject copy constructor failed"); stage.Remove(actor); @@ -138,20 +136,20 @@ void RefObjReferenceUnReference() DALI_CHECK_FAIL(!RefObjInit(stage,actor,&vec3SetPosition), "Initialization failed" ); BaseHandle BaseRefobject = actor; - DALI_CHECK_FAIL(!BaseRefobject, "RefObjobject is not created" ); - nCount1 = BaseRefobject.GetBaseObject().ReferenceCount(); + DALI_CHECK_FAIL(!BaseRefobject, "RefObjobject is not created" ); + nCount1 = BaseRefobject.GetBaseObject().ReferenceCount(); RefObject *pRefobject = BaseRefobject.GetObjectPtr(); DALI_CHECK_FAIL(pRefobject == NULL, "Reference is NULL after assigning basehandle to it" ); - pRefobject->Reference(); - nFlag = pRefobject->ReferenceCount(); - DALI_CHECK_FAIL(nCount1 >= nFlag, "Referencing was not successful"); - pRefobject->Unreference(); + pRefobject->Reference(); + nFlag = pRefobject->ReferenceCount(); + DALI_CHECK_FAIL(nCount1 >= nFlag, "Referencing was not successful"); + pRefobject->Unreference(); nCount = pRefobject->ReferenceCount(); DALI_CHECK_FAIL(nCount != nCount1, "Decrement the object's reference count not successful"); - + stage.Remove(actor); DaliLog::PrintPass(); } diff --git a/src/itc/dali-core/stage/ITs-stage-impl.h b/src/itc/dali-core/stage/ITs-stage-impl.h index 7650d21..aebcafd 100755 --- a/src/itc/dali-core/stage/ITs-stage-impl.h +++ b/src/itc/dali-core/stage/ITs-stage-impl.h @@ -106,6 +106,21 @@ void StageCopyConstructor() vec4GetColor = stageCopy.GetBackgroundColor(); DALI_CHECK_FAIL(vec4GetColor!=vec4SetColor, "CopyConstructor is failed."); + float DEFAULT_HORIZONTAL_DPI = 0.0f; + float DEFAULT_VERTICAL_DPI = 0.0f; + Vector2 vecDpi = stage.GetDpi(); + DALI_CHECK_FAIL(vecDpi.x <= static_cast( DEFAULT_HORIZONTAL_DPI ), "Get Dpi horizontal failed"); + DALI_CHECK_FAIL(vecDpi.y <= static_cast( DEFAULT_VERTICAL_DPI ), "Get Dpi vertical failed"); + + try + { + stage.KeepRendering( 0.1f ); + } + catch(...) + { + DALI_CHECK_FAIL( true, "KeepRendering() is failed" ); + } + DaliLog::PrintPass(); } diff --git a/src/itc/dali-core/stage/ITs-stage.cpp b/src/itc/dali-core/stage/ITs-stage.cpp index 1bbc15d..6867894 100755 --- a/src/itc/dali-core/stage/ITs-stage.cpp +++ b/src/itc/dali-core/stage/ITs-stage.cpp @@ -243,7 +243,9 @@ int ITcStageAdd(void) * Creates another object using copy constructor\n * Gets the background color using newly created Object\n * Checks whether they are equal or not\n -* @apicovered stage(Dali::Stage const&),GetCurrent,SetBackgroundColor,GetBackgroundColor +* Get stage dpi and check with default value. \n +* Check KeepRendering is work or not. +* @apicovered stage(Dali::Stage const&),GetCurrent,SetBackgroundColor,GetBackgroundColor,GetDpi(),KeepRendering() * @passcase If Copy constructor works properly than pass * @failcase If Fail to work Copy constructor properly * @precondition NA diff --git a/src/itc/dali-core/tct-dali-core-native_common_iot.h b/src/itc/dali-core/tct-dali-core-native_common_iot.h index 2e218dc..fee5018 100755 --- a/src/itc/dali-core/tct-dali-core-native_common_iot.h +++ b/src/itc/dali-core/tct-dali-core-native_common_iot.h @@ -241,6 +241,7 @@ extern int ITcActorInsertRotateByRadianQuenterion(void); extern int ITcActorGetNaturalSizeResizePolicy(void); extern int ITcActorAssignmentOperatorGetRelayoutSize(void); extern int ITcActorSetInheritPosition(void); +extern int ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal(void); extern int ITcAlphaFunctionDefault(void); extern int ITcAlphaFunctionBuiltinFunction(void); extern int ITcAlphaFunctionByFunctionPrototypeGetCustomFunction(void); @@ -1060,6 +1061,7 @@ testcase tc_array[] = { {"ITcActorGetNaturalSizeResizePolicy", ITcActorGetNaturalSizeResizePolicy, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorAssignmentOperatorGetRelayoutSize", ITcActorAssignmentOperatorGetRelayoutSize, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorSetInheritPosition", ITcActorSetInheritPosition, ITs_actor_startup, ITs_actor_cleanup}, + {"ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal", ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal, ITs_actor_startup, ITs_actor_cleanup}, {"ITcAlphaFunctionDefault", ITcAlphaFunctionDefault, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionBuiltinFunction", ITcAlphaFunctionBuiltinFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionByFunctionPrototypeGetCustomFunction", ITcAlphaFunctionByFunctionPrototypeGetCustomFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, diff --git a/src/itc/dali-core/tct-dali-core-native_mobile.h b/src/itc/dali-core/tct-dali-core-native_mobile.h index 2e218dc..fee5018 100755 --- a/src/itc/dali-core/tct-dali-core-native_mobile.h +++ b/src/itc/dali-core/tct-dali-core-native_mobile.h @@ -241,6 +241,7 @@ extern int ITcActorInsertRotateByRadianQuenterion(void); extern int ITcActorGetNaturalSizeResizePolicy(void); extern int ITcActorAssignmentOperatorGetRelayoutSize(void); extern int ITcActorSetInheritPosition(void); +extern int ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal(void); extern int ITcAlphaFunctionDefault(void); extern int ITcAlphaFunctionBuiltinFunction(void); extern int ITcAlphaFunctionByFunctionPrototypeGetCustomFunction(void); @@ -1060,6 +1061,7 @@ testcase tc_array[] = { {"ITcActorGetNaturalSizeResizePolicy", ITcActorGetNaturalSizeResizePolicy, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorAssignmentOperatorGetRelayoutSize", ITcActorAssignmentOperatorGetRelayoutSize, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorSetInheritPosition", ITcActorSetInheritPosition, ITs_actor_startup, ITs_actor_cleanup}, + {"ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal", ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal, ITs_actor_startup, ITs_actor_cleanup}, {"ITcAlphaFunctionDefault", ITcAlphaFunctionDefault, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionBuiltinFunction", ITcAlphaFunctionBuiltinFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionByFunctionPrototypeGetCustomFunction", ITcAlphaFunctionByFunctionPrototypeGetCustomFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, diff --git a/src/itc/dali-core/tct-dali-core-native_tv.h b/src/itc/dali-core/tct-dali-core-native_tv.h index 2e218dc..fee5018 100755 --- a/src/itc/dali-core/tct-dali-core-native_tv.h +++ b/src/itc/dali-core/tct-dali-core-native_tv.h @@ -241,6 +241,7 @@ extern int ITcActorInsertRotateByRadianQuenterion(void); extern int ITcActorGetNaturalSizeResizePolicy(void); extern int ITcActorAssignmentOperatorGetRelayoutSize(void); extern int ITcActorSetInheritPosition(void); +extern int ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal(void); extern int ITcAlphaFunctionDefault(void); extern int ITcAlphaFunctionBuiltinFunction(void); extern int ITcAlphaFunctionByFunctionPrototypeGetCustomFunction(void); @@ -1060,6 +1061,7 @@ testcase tc_array[] = { {"ITcActorGetNaturalSizeResizePolicy", ITcActorGetNaturalSizeResizePolicy, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorAssignmentOperatorGetRelayoutSize", ITcActorAssignmentOperatorGetRelayoutSize, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorSetInheritPosition", ITcActorSetInheritPosition, ITs_actor_startup, ITs_actor_cleanup}, + {"ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal", ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal, ITs_actor_startup, ITs_actor_cleanup}, {"ITcAlphaFunctionDefault", ITcAlphaFunctionDefault, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionBuiltinFunction", ITcAlphaFunctionBuiltinFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionByFunctionPrototypeGetCustomFunction", ITcAlphaFunctionByFunctionPrototypeGetCustomFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, diff --git a/src/itc/dali-core/tct-dali-core-native_wearable.h b/src/itc/dali-core/tct-dali-core-native_wearable.h index 2e218dc..fee5018 100755 --- a/src/itc/dali-core/tct-dali-core-native_wearable.h +++ b/src/itc/dali-core/tct-dali-core-native_wearable.h @@ -241,6 +241,7 @@ extern int ITcActorInsertRotateByRadianQuenterion(void); extern int ITcActorGetNaturalSizeResizePolicy(void); extern int ITcActorAssignmentOperatorGetRelayoutSize(void); extern int ITcActorSetInheritPosition(void); +extern int ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal(void); extern int ITcAlphaFunctionDefault(void); extern int ITcAlphaFunctionBuiltinFunction(void); extern int ITcAlphaFunctionByFunctionPrototypeGetCustomFunction(void); @@ -1060,6 +1061,7 @@ testcase tc_array[] = { {"ITcActorGetNaturalSizeResizePolicy", ITcActorGetNaturalSizeResizePolicy, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorAssignmentOperatorGetRelayoutSize", ITcActorAssignmentOperatorGetRelayoutSize, ITs_actor_startup, ITs_actor_cleanup}, {"ITcActorSetInheritPosition", ITcActorSetInheritPosition, ITs_actor_startup, ITs_actor_cleanup}, + {"ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal", ITcActorGetHierarchyDepthAddRemoveRendererScreenToLocal, ITs_actor_startup, ITs_actor_cleanup}, {"ITcAlphaFunctionDefault", ITcAlphaFunctionDefault, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionBuiltinFunction", ITcAlphaFunctionBuiltinFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, {"ITcAlphaFunctionByFunctionPrototypeGetCustomFunction", ITcAlphaFunctionByFunctionPrototypeGetCustomFunction, ITs_alphafunctions_startup, ITs_alphafunctions_cleanup}, -- 2.7.4