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-RadioButton.cpp;h=521d6cab182b57f1f694f3c1e9e8e67a8b39d904;hp=9b3c9e500554eff7326f0bfe8d41b5b22e31db89;hb=1263805136b9938e348fd4e519e64fa9bad20f94;hpb=dc3613bb6248908c267a76e378b04962bce85664 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp index 9b3c9e5..521d6ca 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp @@ -47,10 +47,45 @@ static void TestCallback(BaseHandle handle) } -int UtcDaliRadioButtonNew(void) +int UtcDaliRadioButtonConstructorP(void) +{ + TestApplication application; + + RadioButton button; + + DALI_TEST_CHECK( !button ); + END_TEST; +} + +int UtcDaliRadioButtonCopyConstructorP(void) +{ + TestApplication application; + + // Initialize an object, ref count == 1 + RadioButton button = RadioButton::New(); + + RadioButton copy( button ); + DALI_TEST_CHECK( copy ); + END_TEST; +} + +int UtcDaliRadioButtonAssignmentOperatorP(void) +{ + TestApplication application; + + RadioButton button = RadioButton::New(); + + RadioButton copy( button ); + DALI_TEST_CHECK( copy ); + + DALI_TEST_CHECK( button == copy ); + END_TEST; +} + +int UtcDaliRadioButtonNewP(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliRadioButtonNew"); + tet_infoline(" UtcDaliRadioButtonNewP"); // Create the Slider actor RadioButton radioButton; @@ -78,7 +113,7 @@ int UtcDaliRadioButtonNew(void) END_TEST; } -int UtcDaliRadioButtonDestructor(void) +int UtcDaliRadioButtonDestructorP(void) { ToolkitTestApplication application; @@ -105,12 +140,12 @@ int UtcDaliRadioButtonLabelActor(void) { ToolkitTestApplication application; - TextView actor1 = TextView::New( "test actor 1" ); + TextLabel actor1 = TextLabel::New( "test actor 1" ); RadioButton radioButton = RadioButton::New( actor1 ); DALI_TEST_CHECK( actor1 == radioButton.GetLabel() ); - TextView actor2 = TextView::New( "test actor 2" ); + TextLabel actor2 = TextLabel::New( "test actor 2" ); radioButton.SetLabel( actor2 ); DALI_TEST_CHECK( actor2 == radioButton.GetLabel() ); @@ -154,19 +189,19 @@ int UtcDaliRadioButtonSelectedProperty(void) radioButton.SetPosition( 0.0f, 0.0f ); // Default selected - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Setting false selected - radioButton.SetProperty( Button::PROPERTY_SELECTED, false ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + radioButton.SetProperty( Button::Property::SELECTED, false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Setting true selected - radioButton.SetProperty( Button::PROPERTY_SELECTED, true ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == true ); + radioButton.SetProperty( Button::Property::SELECTED, true ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == true ); // Setting false again - radioButton.SetProperty( Button::PROPERTY_SELECTED, false ); - DALI_TEST_CHECK( radioButton.GetProperty( Button::PROPERTY_SELECTED ) == false ); + radioButton.SetProperty( Button::Property::SELECTED, false ); + DALI_TEST_CHECK( radioButton.GetProperty( Button::Property::SELECTED ) == false ); // Test selecting radio buttons RadioButton radioButton2 = RadioButton::New( "label" ); @@ -193,8 +228,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.Render(); // Simulate touch events - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); // Select first radio { @@ -213,8 +248,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == true ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == true ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); } // Select an already selected radio @@ -234,8 +269,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == true ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == false ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == true ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == false ); } // Select second radio @@ -255,8 +290,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == true ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == true ); } // Select outside radio group @@ -276,8 +311,8 @@ int UtcDaliRadioButtonSelectedProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( radioButton2.GetProperty( Button::PROPERTY_SELECTED ) == false ); - DALI_TEST_CHECK( radioButton3.GetProperty( Button::PROPERTY_SELECTED ) == true ); + DALI_TEST_CHECK( radioButton2.GetProperty( Button::Property::SELECTED ) == false ); + DALI_TEST_CHECK( radioButton3.GetProperty( Button::Property::SELECTED ) == true ); } END_TEST;