Removed REQUIRES_STYLE_CHANGE_SIGNALS
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ProgressBar.cpp
index d6f125d..9e421fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -76,7 +76,7 @@ int UtcDaliProgressBarNew(void)
   DALI_TEST_CHECK( progressBar3 == progressBar2 );
 
   //Additional check to ensure object is created by checking if it's registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
   DALI_TEST_CHECK( registry );
 
   gObjectCreatedCallBackCalled = false;
@@ -115,6 +115,71 @@ int UtcDaliProgressBarDestructor(void)
   END_TEST;
 }
 
+int UtcDaliProgressBarCopyConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  ProgressBar progressBar = ProgressBar::New();
+  DALI_TEST_CHECK( progressBar );
+
+  ProgressBar copy( progressBar );
+  DALI_TEST_CHECK( copy );
+
+  END_TEST;
+}
+
+int UtcDaliProgressBarCopyAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  ProgressBar progressBar = ProgressBar::New();
+  DALI_TEST_CHECK( progressBar );
+
+  ProgressBar copy;
+  copy = progressBar;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_EQUALS( progressBar, copy, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliProgressBarMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  ProgressBar progressBar = ProgressBar::New();
+  DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+  DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+  ProgressBar moved = std::move( progressBar );
+  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( !progressBar );
+
+  END_TEST;
+}
+
+int UtcDaliProgressBarMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  ProgressBar progressBar = ProgressBar::New();
+  DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+  DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+  ProgressBar moved;
+  moved = std::move( progressBar );
+  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( !progressBar );
+
+  END_TEST;
+}
+
 int UtcDaliProgressBarDownCast(void)
 {
   ToolkitTestApplication application;
@@ -141,10 +206,10 @@ int UtcDaliProgressBarSignals(void)
 
   // Create the ProgressBar actor
   ProgressBar progressBar = ProgressBar::New();
-  Stage::GetCurrent().Add( progressBar );
+  application.GetScene().Add( progressBar );
   progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
-  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
   progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
   progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
 
@@ -174,10 +239,10 @@ int UtcDaliProgressBarSetPropertyP(void)
   ProgressBar progressBar = ProgressBar::New();
   progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
-  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
   progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
   progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
-  Stage::GetCurrent().Add(progressBar);
+  application.GetScene().Add(progressBar);
   application.SendNotification();
   application.Render();
 
@@ -321,11 +386,11 @@ int UtcDaliProgressBarSetPropertyP1(void)
   ProgressBar progressBar = ProgressBar::New();
   progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
-  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
   progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
   progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
 
-  Stage::GetCurrent().Add(progressBar);
+  application.GetScene().Add(progressBar);
   application.SendNotification();
   application.Render();
 
@@ -414,8 +479,8 @@ int UtcDaliProgressBarSetPropertyP2(void)
   progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.3f);
 
   progressBar.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
-  Stage::GetCurrent().Add(progressBar);
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
+  application.GetScene().Add(progressBar);
   application.SendNotification();
   application.Render();
 
@@ -438,8 +503,8 @@ int UtcDaliProgressBarSetPropertyP3(void)
   ProgressBar progressBar = ProgressBar::New();
   progressBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
   progressBar.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
-  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y ) );
-  Stage::GetCurrent().Add( progressBar );
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, application.GetScene().GetSize().y ) );
+  application.GetScene().Add( progressBar );
   application.SendNotification();
   application.Render();