Updates for const->constexpr
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-RadioButton.cpp
index 666ce5c..ee1ebf5 100644 (file)
@@ -86,6 +86,25 @@ int UtcDaliRadioButtonCopyConstructorP(void)
   END_TEST;
 }
 
+int UtcDaliRadioButtonMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  RadioButton button = RadioButton::New();
+  DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+  button.SetProperty( Button::Property::TOGGLABLE, false );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+  RadioButton moved = std::move( button );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+  DALI_TEST_CHECK( !button );
+
+  END_TEST;
+}
+
 int UtcDaliRadioButtonAssignmentOperatorP(void)
 {
   TestApplication application;
@@ -99,6 +118,26 @@ int UtcDaliRadioButtonAssignmentOperatorP(void)
   END_TEST;
 }
 
+int UtcDaliRadioButtonMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  RadioButton button = RadioButton::New();
+  DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+  button.SetProperty( Button::Property::TOGGLABLE, false );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+
+  RadioButton moved;
+  moved = std::move( button );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+  DALI_TEST_CHECK( !button );
+
+  END_TEST;
+}
+
 int UtcDaliRadioButtonNewP(void)
 {
   ToolkitTestApplication application;
@@ -118,7 +157,7 @@ int UtcDaliRadioButtonNewP(void)
   DALI_TEST_CHECK( radioButton2 == radioButton );
 
   //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;