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-BloomView.cpp;h=2105c4adeadcd6dc7f863c51eb741d288be7979a;hp=81cbe9630dbc2a8bc7f49074775d83e764d5eb07;hb=HEAD;hpb=8c98262c52c72d5767c4552bb3c294a1565aefaa diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp index 81cbe96..f328ef2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -15,17 +15,15 @@ * */ -#include -#include #include #include #include - +#include +#include using namespace Dali; using namespace Dali::Toolkit; - void bloom_view_startup(void) { test_return_value = TET_UNDEF; @@ -48,13 +46,13 @@ int UtcDaliBloomViewUninitialized(void) { // New() must be called to create a BloomView or it wont be valid. Actor a = Actor::New(); - view.Add( a ); - DALI_TEST_CHECK( false ); + view.Add(a); + DALI_TEST_CHECK(false); } - catch (Dali::DaliException& e) + catch(Dali::DaliException& e) { // Tests that a negative test of an assertion succeeds - DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_PRINT_ASSERT(e); DALI_TEST_CHECK(!view); } END_TEST; @@ -67,10 +65,10 @@ int UtcDaliBloomViewNew(void) tet_infoline(" UtcDaliBloomViewNew"); Toolkit::BloomView view = Toolkit::BloomView::New(); - DALI_TEST_CHECK( view ); + DALI_TEST_CHECK(view); Toolkit::BloomView view2 = Toolkit::BloomView::New(10, 1.0f, Pixel::RGB888, 0.5f, 0.5f); - DALI_TEST_CHECK( view2 ); + DALI_TEST_CHECK(view2); END_TEST; } @@ -81,16 +79,15 @@ int UtcDaliBloomViewDownCast(void) tet_infoline(" UtcDaliBloomViewDownCast"); Toolkit::BloomView view = Toolkit::BloomView::New(); - BaseHandle handle(view); + BaseHandle handle(view); - Toolkit::BloomView bloomView = Toolkit::BloomView::DownCast( handle ); - DALI_TEST_CHECK( view ); - DALI_TEST_CHECK( bloomView ); - DALI_TEST_CHECK( bloomView == view ); + Toolkit::BloomView bloomView = Toolkit::BloomView::DownCast(handle); + DALI_TEST_CHECK(view); + DALI_TEST_CHECK(bloomView); + DALI_TEST_CHECK(bloomView == view); END_TEST; } - // Positive test case for a method int UtcDaliBloomViewPropertyNames(void) { @@ -98,16 +95,16 @@ int UtcDaliBloomViewPropertyNames(void) tet_infoline(" UtcDaliBloomViewPropertyNames"); Toolkit::BloomView view = Toolkit::BloomView::New(); - DALI_TEST_CHECK( view ); + DALI_TEST_CHECK(view); // Check the names, this names are used in the shader code, // if they change in the shader code, then it has to be updated here. - DALI_TEST_EQUALS( view.GetBloomThresholdPropertyIndex(), view.GetPropertyIndex("uBloomThreshold"), TEST_LOCATION ); - DALI_TEST_EQUALS( view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION ); - DALI_TEST_EQUALS( view.GetBloomIntensityPropertyIndex(), view.GetPropertyIndex("uBloomIntensity"), TEST_LOCATION ); - DALI_TEST_EQUALS( view.GetBloomSaturationPropertyIndex(), view.GetPropertyIndex("uBloomSaturation"), TEST_LOCATION ); - DALI_TEST_EQUALS( view.GetImageIntensityPropertyIndex(), view.GetPropertyIndex("uImageIntensity"), TEST_LOCATION ); - DALI_TEST_EQUALS( view.GetImageSaturationPropertyIndex(), view.GetPropertyIndex("uImageSaturation"), TEST_LOCATION ); + DALI_TEST_EQUALS(view.GetBloomThresholdPropertyIndex(), view.GetPropertyIndex("uBloomThreshold"), TEST_LOCATION); + DALI_TEST_EQUALS(view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION); + DALI_TEST_EQUALS(view.GetBloomIntensityPropertyIndex(), view.GetPropertyIndex("uBloomIntensity"), TEST_LOCATION); + DALI_TEST_EQUALS(view.GetBloomSaturationPropertyIndex(), view.GetPropertyIndex("uBloomSaturation"), TEST_LOCATION); + DALI_TEST_EQUALS(view.GetImageIntensityPropertyIndex(), view.GetPropertyIndex("uImageIntensity"), TEST_LOCATION); + DALI_TEST_EQUALS(view.GetImageSaturationPropertyIndex(), view.GetPropertyIndex("uImageSaturation"), TEST_LOCATION); END_TEST; } @@ -118,22 +115,21 @@ int UtcDaliBloomViewAddRemove(void) tet_infoline(" UtcDaliBloomViewAddRemove"); Toolkit::BloomView view = Toolkit::BloomView::New(); - DALI_TEST_CHECK( view ); + DALI_TEST_CHECK(view); Actor actor = Actor::New(); - DALI_TEST_CHECK( !actor.OnStage() ); - + DALI_TEST_CHECK(!actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE)); - view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - view.SetSize(Stage::GetCurrent().GetSize()); + view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize()); view.Add(actor); - Stage::GetCurrent().Add(view); + application.GetScene().Add(view); - DALI_TEST_CHECK( actor.OnStage() ); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE)); view.Remove(actor); - DALI_TEST_CHECK( !actor.OnStage() ); + DALI_TEST_CHECK(!actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE)); END_TEST; } @@ -144,24 +140,24 @@ int UtcDaliBloomActivateDeactivate(void) tet_infoline(" UtcDaliBloomActivateDeactivate"); Toolkit::BloomView view = Toolkit::BloomView::New(); - DALI_TEST_CHECK( view ); + DALI_TEST_CHECK(view); - RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); - DALI_TEST_CHECK( 1u == taskList.GetTaskCount() ); + RenderTaskList taskList = application.GetScene().GetRenderTaskList(); + DALI_TEST_CHECK(1u == taskList.GetTaskCount()); - view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - view.SetSize(Stage::GetCurrent().GetSize()); + view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize()); view.Add(Actor::New()); - Stage::GetCurrent().Add(view); + application.GetScene().Add(view); view.Activate(); - RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList(); - DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() ); + RenderTaskList taskList2 = application.GetScene().GetRenderTaskList(); + DALI_TEST_CHECK(1u != taskList2.GetTaskCount()); view.Deactivate(); - RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList(); - DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() ); + RenderTaskList taskList3 = application.GetScene().GetRenderTaskList(); + DALI_TEST_CHECK(1u == taskList3.GetTaskCount()); END_TEST; } @@ -170,16 +166,16 @@ int UtcDaliBloomCopyAndAssignment(void) ToolkitTestApplication application; BloomView view = Toolkit::BloomView::New(); - DALI_TEST_CHECK( view ); + DALI_TEST_CHECK(view); - BloomView copy( view ); - DALI_TEST_CHECK( view == copy ); + BloomView copy(view); + DALI_TEST_CHECK(view == copy); BloomView assign; - DALI_TEST_CHECK( ! assign ); + DALI_TEST_CHECK(!assign); assign = copy; - DALI_TEST_CHECK( assign == view ); + DALI_TEST_CHECK(assign == view); END_TEST; } @@ -189,16 +185,16 @@ int UtcDaliBloomTypeRegistry(void) ToolkitTestApplication application; TypeRegistry typeRegistry = TypeRegistry::Get(); - DALI_TEST_CHECK( typeRegistry ); + DALI_TEST_CHECK(typeRegistry); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "BloomView" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("BloomView"); + DALI_TEST_CHECK(typeInfo); BaseHandle handle = typeInfo.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); - BloomView view = BloomView::DownCast( handle ); - DALI_TEST_CHECK( view ); + BloomView view = BloomView::DownCast(handle); + DALI_TEST_CHECK(view); END_TEST; } @@ -209,18 +205,18 @@ int UtcDaliBloomOnSizeSet(void) BloomView view = Toolkit::BloomView::New(); - Stage::GetCurrent().Add( view ); + application.GetScene().Add(view); application.SendNotification(); application.Render(); - Vector3 size( 200.0f, 300.0f, 0.0f ); - view.SetSize( size ); + Vector3 size(200.0f, 300.0f, 0.0f); + view.SetProperty(Actor::Property::SIZE, size); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), size, TEST_LOCATION ); + DALI_TEST_EQUALS(view.GetCurrentProperty(Actor::Property::SIZE), size, TEST_LOCATION); END_TEST; }