//////////////////////////////////////////////////////////
+int UtcDaliPushButtonDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonDownCast");
+
+ TETButton tetButton= Toolkit::TETButton::New();
+
+ BaseHandle object(tetButton);
+
+ TETButton tetButton2 = TETButton::DownCast( object );
+ DALI_TEST_CHECK(tetButton2);
+
+ TETButton tetButton3 = DownCast< TETButton >(object);
+ DALI_TEST_CHECK(tetButton3);
+ END_TEST;
+}
int UtcDaliPushButtonInterruptEventWhenInsensitive(void)
{
}
DummyControlImpl::DummyControlImpl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
mCustomSlot1Called(false)
{
}
DummyControlImplOverride::DummyControlImplOverride()
: DummyControlImpl(),
initializeCalled(false),
+ activatedCalled(false),
themeChangeCalled( false ),
fontChangeCalled( false ),
pinchCalled(false),
sizeSetCalled(false),
sizeAnimationCalled(false),
touchEventCalled(false),
+ hoverEventCalled(false),
mouseWheelEventCalled(false),
keyEventCalled(false),
keyInputFocusGained(false),
void DummyControlImplOverride::OnInitialize() { initializeCalled = true; }
+void DummyControlImplOverride::OnActivated() { activatedCalled = true; }
void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
themeChangeCalled = change == StyleChange::THEME_CHANGE;
void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; }
void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; }
bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
+bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
bool DummyControlImplOverride::OnMouseWheelEvent(const MouseWheelEvent& event) { mouseWheelEventCalled = true; return false; }
bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
void DummyControlImplOverride::OnKeyInputFocusGained() { keyInputFocusGained = true; }
private: // From Internal::Control
virtual void OnInitialize();
+ virtual void OnActivated();
virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
virtual void OnPinch(const PinchGesture& pinch);
virtual void OnPan(const PanGesture& pan);
virtual void OnSizeSet(const Vector3& targetSize);
virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
virtual bool OnTouchEvent(const TouchEvent& event);
+ virtual bool OnHoverEvent(const HoverEvent& event);
virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
virtual bool OnKeyEvent(const KeyEvent& event);
virtual void OnKeyInputFocusGained();
public:
bool initializeCalled;
+ bool activatedCalled;
bool themeChangeCalled;
bool fontChangeCalled;
bool pinchCalled;
bool sizeSetCalled;
bool sizeAnimationCalled;
bool touchEventCalled;
+ bool hoverEventCalled;
bool mouseWheelEventCalled;
bool keyEventCalled;
bool keyInputFocusGained;
namespace
{
-static bool gButtonClicked = false;
+static bool gIsCalledButtonCallback = false;
-static bool ButtonClicked( Button button )
+static bool ButtonCallback( Button button )
{
- gButtonClicked = true;
+ gIsCalledButtonCallback = true;
return false;
}
static float ANIMATION_TIME( 0.5f );
} // namespace
+int UtcDaliButtonConstructorP(void)
+{
+ TestApplication application;
+
+ Button button;
+
+ DALI_TEST_CHECK( !button );
+ END_TEST;
+}
+
+int UtcDaliButtonCopyConstructorP(void)
+{
+ TestApplication application;
+
+ // Initialize an object, ref count == 1
+ Button button = PushButton::New();
+
+ Button copy( button );
+ DALI_TEST_CHECK( copy );
+ END_TEST;
+}
+
+int UtcDaliButtonAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ Button button = PushButton::New();
+
+ Button copy( button );
+ DALI_TEST_CHECK( copy );
+
+ DALI_TEST_CHECK( button == copy );
+ END_TEST;
+}
+
+int UtcDaliButtonDownCastP(void)
+{
+ TestApplication application;
+
+ Button button = PushButton::New();
+
+ BaseHandle object(button);
+
+ Button button2 = Button::DownCast( object );
+ DALI_TEST_CHECK(button2);
+
+ Button button3 = DownCast< Button >(object);
+ DALI_TEST_CHECK(button3);
+ END_TEST;
+}
+
+int UtcDaliButtonDownCastN(void)
+{
+ TestApplication application;
+
+ BaseHandle unInitializedObject;
+ Button button1 = Button::DownCast( unInitializedObject );
+ DALI_TEST_CHECK( !button1 );
-// Positive test case for a method
-int UtcDaliButtonNew(void)
+ Button button2 = DownCast< Button >( unInitializedObject );
+ DALI_TEST_CHECK( !button2 );
+ END_TEST;
+}
+
+int UtcDaliButtonSetDisabledP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonNew");
- PushButton pushButton = PushButton::New();
+ Button button = PushButton::New();
- DALI_TEST_CHECK( pushButton );
+ button.SetDisabled( true );
- PushButton pushButton2( pushButton );
+ DALI_TEST_CHECK( button.IsDisabled() );
- DALI_TEST_CHECK( pushButton2 );
+ button.SetDisabled( false );
- pushButton2.Reset();
+ DALI_TEST_CHECK( !button.IsDisabled() );
- // Test down cast
- Handle handleButton;
- handleButton = pushButton;
- Button downCastPushButton = Button::DownCast( handleButton );
- DALI_TEST_CHECK( downCastPushButton );
- PushButton downCastPushButton2 = PushButton::DownCast( handleButton );
- DALI_TEST_CHECK( downCastPushButton2 );
+ button.SetDisabled( true );
+ DALI_TEST_CHECK( button.IsDisabled() );
+
+ button.SetDisabled( false );
+
+ DALI_TEST_CHECK( !button.IsDisabled() );
END_TEST;
}
-int UtcDaliButtonSetProperty(void)
+int UtcDaliButtonIsDisabledP(void)
{
- tet_infoline("UtcDaliButtonSetProperty: ");
ToolkitTestApplication application;
- PushButton pushButton = PushButton::New();
+ Button button = PushButton::New();
- pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
- DALI_TEST_CHECK( false == pushButton.IsDisabled() );
- pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
- DALI_TEST_CHECK( true == pushButton.IsDisabled() );
+ button.SetDisabled( true );
+
+ DALI_TEST_CHECK( button.IsDisabled() );
+
+ button.SetDisabled( false );
+
+ DALI_TEST_CHECK( !button.IsDisabled() );
END_TEST;
}
-int UtcDaliButtonSetGetDimmed(void)
+int UtcDaliButtonSetAutoRepeatingP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonSetGetDimmed");
- PushButton pushButton = PushButton::New();
+ Button button = PushButton::New();
- pushButton.SetDisabled( true );
+ button.SetAutoRepeating( true );
- DALI_TEST_CHECK( pushButton.IsDisabled() );
+ DALI_TEST_CHECK( button.IsAutoRepeating() );
- pushButton.SetDisabled( false );
+ button.SetAutoRepeating( false );
- DALI_TEST_CHECK( !pushButton.IsDisabled() );
+ DALI_TEST_CHECK( !button.IsAutoRepeating() );
- pushButton.SetDisabled( true );
+ button.SetAutoRepeating( true );
- DALI_TEST_CHECK( pushButton.IsDisabled() );
+ DALI_TEST_CHECK( button.IsAutoRepeating() );
- pushButton.SetDisabled( false );
+ button.SetAutoRepeating( false );
- DALI_TEST_CHECK( !pushButton.IsDisabled() );
+ DALI_TEST_CHECK( !button.IsAutoRepeating() );
END_TEST;
}
-int UtcDaliButtonSize(void)
+int UtcDaliButtonIsAutoRepeatingP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonSize");
- ImageActor image01 = ImageActor::New(CreateBufferImage());
- image01.SetSize( 100, 50 );
+ Button button = PushButton::New();
- PushButton pushButton;
+ button.SetAutoRepeating( true );
- Vector3 size;
+ DALI_TEST_CHECK( button.IsAutoRepeating() );
- // Test1 Size is set through Actor API
+ button.SetAutoRepeating( false );
- // First an image is set, then SetSize is called.
- pushButton = PushButton::New();
- Stage::GetCurrent().Add( pushButton );
+ DALI_TEST_CHECK( !button.IsAutoRepeating() );
+ END_TEST;
+}
- pushButton.SetBackgroundImage( image01 );
- pushButton.SetSize( 10.f, 10.f );
+int UtcDaliButtonSetInitialAutoRepeatingDelayP(void)
+{
+ ToolkitTestApplication application;
- application.SendNotification();
- application.Render();
+ Button button = PushButton::New();
- size = pushButton.GetCurrentSize();
+ button.SetInitialAutoRepeatingDelay( 0.5f );
- DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+
+ button.SetInitialAutoRepeatingDelay( 0.2f );
+
+ DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
END_TEST;
}
-int UtcDaliButtonClicked(void)
+int UtcDaliButtonSetNextAutoRepeatingDelayP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonClicked");
- PushButton pushButton = PushButton::New();
- pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- pushButton.SetPosition( 240, 400 );
- pushButton.SetSize( 100, 100 );
+ Button button = PushButton::New();
- Stage::GetCurrent().Add( pushButton );
+ button.SetNextAutoRepeatingDelay( 0.5f );
+
+ DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+
+ button.SetNextAutoRepeatingDelay( 0.2f );
+
+ DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliButtonSetTogglableButtonP(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+
+ button.SetTogglableButton( true );
+
+ DALI_TEST_CHECK( button.IsTogglableButton() );
+
+ button.SetTogglableButton( false );
+
+ DALI_TEST_CHECK( !button.IsTogglableButton() );
+ END_TEST;
+}
+
+int UtcDaliButtonSetSelectedP(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+ button.SetTogglableButton( true );
+
+ button.SetSelected( true );
+
+ DALI_TEST_CHECK( button.IsSelected() );
+
+ button.SetSelected( false );
+
+ DALI_TEST_CHECK( !button.IsSelected() );
+ END_TEST;
+}
+
+int UtcDaliButtonSetAnimationTimeP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSetAnimationTimeP");
+
+ Button button = PushButton::New();
+
+ button.SetAnimationTime( ANIMATION_TIME );
+
+ DALI_TEST_EQUALS( button.GetAnimationTime(), ANIMATION_TIME, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliButtonSetLabelStringP(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+
+ button.SetLabel( "Button Label" );
+
+ DALI_TEST_CHECK( button.GetLabel() );
+ END_TEST;
+}
+
+int UtcDaliButtonSetLabelActorP(void)
+{
+ ToolkitTestApplication application;
+
+ Button button = PushButton::New();
+
+ TextLabel textLabel = TextLabel::New( "Button Label" );
+ button.SetLabel( textLabel );
+
+ DALI_TEST_CHECK( button.GetLabel() );
+ END_TEST;
+}
+
+int UtcDaliButtonPressedSignalP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonPressedSignalP");
+
+ Button button = PushButton::New();
+ button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ button.SetPosition( 240, 400 );
+ button.SetSize( 100, 100 );
+
+ Stage::GetCurrent().Add( button );
application.SendNotification();
application.Render();
// connect to its touch signal
- pushButton.ClickedSignal().Connect( &ButtonClicked );
+ button.PressedSignal().Connect( &ButtonCallback );
+ button.ReleasedSignal().Connect( &ButtonCallback );
Dali::Integration::TouchEvent event;
// Test1. Touch point down and up inside the button.
- gButtonClicked = false;
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointDownInside );
application.ProcessEvent( event );
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointUpInside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( gButtonClicked );
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
// Test2. Touch point down and up outside the button.
- gButtonClicked = false;
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointDownOutside );
application.ProcessEvent( event );
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointUpOutside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( !gButtonClicked );
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
// Test3. Touch point down inside and up outside the button.
- gButtonClicked = false;
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointDownInside );
application.ProcessEvent( event );
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointLeave );
application.ProcessEvent( event );
event.AddPoint( pointUpOutside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( !gButtonClicked );
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
// Test4. Touch point down outside and up inside the button.
- gButtonClicked = false;
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointDownOutside );
application.ProcessEvent( event );
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointEnter );
application.ProcessEvent( event );
event.AddPoint( pointUpInside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( !gButtonClicked );
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
END_TEST;
}
-namespace
-{
-
-static bool gClickedCallBackCalled;
-
-static bool TestClickedCallback(Button button)
-{
- gClickedCallBackCalled = true;
- return true;
-}
-
-} // namespace
-
-int UtcDaliButtonConnectSignal(void)
+int UtcDaliButtonClickedSignalP(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliButtonConnectSignal()");
-
- gClickedCallBackCalled = false;
+ tet_infoline(" UtcDaliButtonClickedSignalP");
- PushButton pushButton = PushButton::New();
- pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- pushButton.SetPosition( 240, 400 );
- pushButton.SetSize( 100, 100 );
+ Button button = PushButton::New();
+ button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ button.SetPosition( 240, 400 );
+ button.SetSize( 100, 100 );
- Stage::GetCurrent().Add( pushButton );
+ Stage::GetCurrent().Add( button );
application.SendNotification();
application.Render();
- // connect to its clicked signal
- pushButton.ClickedSignal().Connect(TestClickedCallback);
+ // connect to its touch signal
+ button.ClickedSignal().Connect( &ButtonCallback );
Dali::Integration::TouchEvent event;
- // Touch point down and up inside the button.
+ // Test1. Touch point down and up inside the button.
+ gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( pointDownInside );
application.ProcessEvent( event );
event.AddPoint( pointUpInside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( gClickedCallBackCalled == true );
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+ // Test2. Touch point down and up outside the button.
+
+ gIsCalledButtonCallback = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointDownOutside );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointUpOutside );
+ application.ProcessEvent( event );
+
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
- gClickedCallBackCalled = false;
- pushButton.ClickedSignal().Disconnect(TestClickedCallback);
+ // Test3. Touch point down inside and up outside the button.
- // simulate another touch event
+ gIsCalledButtonCallback = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointDownInside );
application.ProcessEvent( event );
- DALI_TEST_CHECK( gClickedCallBackCalled == false );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointLeave );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointUpOutside );
+ application.ProcessEvent( event );
+
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+ // Test4. Touch point down outside and up inside the button.
+
+ gIsCalledButtonCallback = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointDownOutside );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointEnter );
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint( pointUpInside );
+ application.ProcessEvent( event );
+
+ DALI_TEST_CHECK( !gIsCalledButtonCallback );
END_TEST;
}
-int UtcDaliButtonSetGetAnimationTime(void)
+int UtcDaliButtonStateChangedSignalP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonSetGetAnimationTime");
+ tet_infoline(" UtcDaliButtonStateChangedSignalP");
+
+ Button button = PushButton::New();
+ button.SetTogglableButton( true );
+
+ Stage::GetCurrent().Add( button );
+
+ application.SendNotification();
+ application.Render();
+
+ // connect to its signal
+ button.StateChangedSignal().Connect( &ButtonCallback );
+
+ gIsCalledButtonCallback = false;
+ button.SetSelected( true );
+
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+ gIsCalledButtonCallback = false;
+ button.SetSelected( false );
+
+ DALI_TEST_CHECK( gIsCalledButtonCallback );
+ END_TEST;
+}
+
+int UtcDaliButtonSetProperty(void)
+{
+ tet_infoline("UtcDaliButtonSetProperty: ");
+ ToolkitTestApplication application;
PushButton pushButton = PushButton::New();
- pushButton.SetAnimationTime( ANIMATION_TIME );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
+ DALI_TEST_CHECK( false == pushButton.IsDisabled() );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
+ DALI_TEST_CHECK( true == pushButton.IsDisabled() );
+ END_TEST;
+}
+
+int UtcDaliButtonSize(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSize");
+
+ ImageActor image01 = ImageActor::New(CreateBufferImage());
+ image01.SetSize( 100, 50 );
+
+ PushButton pushButton;
+
+ Vector3 size;
+
+ // Test1 Size is set through Actor API
+
+ // First an image is set, then SetSize is called.
+ pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ pushButton.SetBackgroundImage( image01 );
+ pushButton.SetSize( 10.f, 10.f );
- DALI_TEST_EQUALS( pushButton.GetAnimationTime(), ANIMATION_TIME, TEST_LOCATION );
+ application.SendNotification();
+ application.Render();
+ size = pushButton.GetCurrentSize();
+
+ DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
END_TEST;
}
return true;
}
-
-
Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
{
BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
} // namespace
-
void checkbox_button_startup(void)
{
test_return_value = TET_UNDEF;
test_return_value = TET_PASS;
}
+int UtcDaliCheckBoxButtonConstructorP(void)
+{
+ TestApplication application;
+
+ CheckBoxButton checkBox;
+
+ DALI_TEST_CHECK( !checkBox );
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonCopyConstructorP(void)
+{
+ TestApplication application;
+
+ // Initialize an object, ref count == 1
+ CheckBoxButton checkBox = CheckBoxButton::New();
+
+ CheckBoxButton copy( checkBox );
+ DALI_TEST_CHECK( copy );
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ CheckBoxButton checkBox = CheckBoxButton::New();
+
+ CheckBoxButton copy( checkBox );
+ DALI_TEST_CHECK( copy );
+
+ DALI_TEST_CHECK( checkBox == copy );
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonNewP(void)
+{
+ TestApplication application;
+
+ CheckBoxButton checkBox = CheckBoxButton::New();
+
+ DALI_TEST_CHECK( checkBox );
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonDownCastP(void)
+{
+ TestApplication application;
+
+ CheckBoxButton checkBox = CheckBoxButton::New();
+
+ BaseHandle object(checkBox);
+
+ CheckBoxButton checkBox2 = CheckBoxButton::DownCast( object );
+ DALI_TEST_CHECK(checkBox2);
+
+ CheckBoxButton checkBox3 = DownCast< CheckBoxButton >(object);
+ DALI_TEST_CHECK(checkBox3);
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonDownCastN(void)
+{
+ TestApplication application;
+
+ BaseHandle unInitializedObject;
+
+ CheckBoxButton checkBox1 = CheckBoxButton::DownCast( unInitializedObject );
+ DALI_TEST_CHECK( !checkBox1 );
+
+ CheckBoxButton checkBox2 = DownCast< CheckBoxButton >( unInitializedObject );
+ DALI_TEST_CHECK( !checkBox2 );
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetBackgroundImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCheckBoxButtonSetBackgroundImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+ checkBoxButton.SetBackgroundImage( image );
+
+ DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
+
+ checkBoxButton.SetBackgroundImage( imageActor );
+
+ DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
+
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetSelectedImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCheckBoxButtonSetSelectedImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+ checkBoxButton.SetSelectedImage( image );
+
+ DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
+
+ checkBoxButton.SetSelectedImage( imageActor );
+
+ DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
+
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetDisabledBackgroundImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCheckBoxButtonSetDisabledBackgroundImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+ checkBoxButton.SetDisabledBackgroundImage( image );
+
+ DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
+
+ checkBoxButton.SetDisabledBackgroundImage( imageActor );
+
+ DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
+
+ END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetDisabledSelectedImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliCheckBoxButtonSetDisabledSelectedImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+ checkBoxButton.SetDisabledSelectedImage( image );
+
+ DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
+
+ checkBoxButton.SetDisabledSelectedImage( imageActor );
+
+ DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
+
+ END_TEST;
+}
+
int UtcDaliCheckBoxButtonSetGetSelected(void)
{
ToolkitTestApplication application;
#include <dali/integration-api/events/pan-gesture-event.h>
#include <dali/integration-api/events/tap-gesture-event.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/hover-event-integ.h>
#include "dummy-control.h"
END_TEST;
}
+int UtcDaliControlImplHoverEvent(void)
+{
+ ToolkitTestApplication application;
+
+ {
+ DummyControl dummy = DummyControl::New( true );
+ DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+
+ dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+ dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ Stage::GetCurrent().Add(dummy);
+
+ application.Render();
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, false, TEST_LOCATION );
+ Integration::HoverEvent event(1);
+ TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
+ event.AddPoint( point );
+ application.ProcessEvent( event );
+ DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION );
+
+ Stage::GetCurrent().Remove(dummy);
+ }
+
+ // Ensure full code coverage
+ {
+ DummyControl dummy = DummyControl::New();
+
+ dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+ dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ Stage::GetCurrent().Add(dummy);
+
+ application.Render();
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ Integration::HoverEvent event(1);
+ TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
+ event.AddPoint( point );
+ application.ProcessEvent( event );
+
+ Stage::GetCurrent().Remove(dummy);
+ }
+ END_TEST;
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
}
END_TEST;
}
+
+int UtcDaliControlImplSetStyleName(void)
+{
+ ToolkitTestApplication application;
+
+ {
+ DummyControl dummy = DummyControl::New( true );
+ DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+
+ dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+ dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ Stage::GetCurrent().Add(dummy);
+
+ dummy.SetStyleName("TestStyle");
+
+ DALI_TEST_CHECK( dummy.GetStyleName() == "TestStyle" );
+
+ Stage::GetCurrent().Remove(dummy);
+ }
+ END_TEST;
+}
// Set the orientation of the layout to be horizontal from left to right
ItemLayoutPtr layout = view.GetLayout(0);
+
+ DALI_TEST_CHECK(gridLayout == layout);
+
layout->SetOrientation(ControlOrientation::Left);
// Check the orientation of the layout is horizontal from left to right
DALI_TEST_CHECK(layout->GetOrientation() == ControlOrientation::Left);
+
+ Vector3 itemSize(100.0f, 100.0f, 100.0f);
+ layout->SetItemSize(itemSize);
+
+ Vector3 itemSize1;
+ layout->GetItemSize(0u, Vector3(Stage::GetCurrent().GetSize()), itemSize1);
+
+ DALI_TEST_CHECK(itemSize == itemSize1);
+
+ float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(Stage::GetCurrent().GetSize()));
+
+ DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
+
+ int focusItem = layout->GetNextFocusItemID(0, TOTAL_ITEM_NUMBER, Control::Left, true);
+
+ DALI_TEST_CHECK(focusItem != 0);
+
+ float flickSpeedFactor = layout->GetFlickSpeedFactor();
+
+ DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
+
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ view.AddLayout(*depthLayout);
+
+ layout = view.GetLayout(1);
+ DALI_TEST_CHECK(depthLayout == layout);
+
+ ItemLayoutPtr listLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
+ view.AddLayout(*listLayout);
+
+ layout = view.GetLayout(2);
+ DALI_TEST_CHECK(listLayout == layout);
+
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ view.AddLayout(*spiralLayout);
+
+ layout = view.GetLayout(3);
+ DALI_TEST_CHECK(spiralLayout == layout);
END_TEST;
}
// Set the interval between refreshes to be 20
view.SetRefreshInterval(20);
+ view.Refresh();
+
// Check the interval between refreshes is 20
DALI_TEST_CHECK(view.GetRefreshInterval() == 20);
END_TEST;
DALI_TEST_EQUALS(view.GetMouseWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliItemViewInsertItemP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ // Get the item given the item ID
+ Actor itemActor = view.GetItem(2);
+
+ ItemId id = view.GetItemId( itemActor );
+
+ // Check we are getting the correct Item ID given the specified actor
+ DALI_TEST_CHECK(view.GetItemId(itemActor) == 2);
+
+ Actor newActor = Actor::New();
+
+ view.InsertItem(Item(id, newActor), 0.5f);
+
+ DALI_TEST_CHECK(view.GetItem(2) == newActor);
+ END_TEST;
+}
+
+int UtcDaliItemViewInsertItemsP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ unsigned int itemCount = view.GetChildCount();
+
+ ItemContainer insertList;
+
+ for( unsigned int i = 0u; i < 10; ++i )
+ {
+ Actor child = view.GetChildAt( i );
+ Actor newActor = Actor::New();
+ newActor.SetName("Inserted");
+ insertList.push_back( Item( view.GetItemId(child), newActor ) );
+ }
+
+ if( !insertList.empty() )
+ {
+ view.InsertItems( insertList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetChildCount() == itemCount + 10);
+
+ ItemIdContainer removeList;
+
+ for( unsigned int i = 0u; i < view.GetChildCount(); ++i )
+ {
+ Actor child = view.GetChildAt( i );
+
+ if( child.GetName() == "Inserted" )
+ {
+ removeList.push_back( view.GetItemId(child) );
+ }
+ }
+
+ if( ! removeList.empty() )
+ {
+ view.RemoveItems( removeList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetChildCount() == itemCount);
+ END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Actor newActor = Actor::New();
+
+ view.ReplaceItem( Item( 0, newActor ), 0.5f );
+
+ DALI_TEST_CHECK(view.GetItem(0) == newActor);
+ END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemsP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ ItemContainer replaceList;
+
+ for( unsigned int i = 0u; i < 10; ++i )
+ {
+ Actor child = view.GetChildAt( i );
+ Actor newActor = Actor::New();
+ newActor.SetName("Replaced");
+
+ replaceList.push_back( Item( view.GetItemId(child), newActor ) );
+ }
+
+ if( !replaceList.empty() )
+ {
+ view.ReplaceItems( replaceList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetItem(0).GetName() == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(8).GetName() == "Replaced");
+ END_TEST;
+}
+
+int UtcDaliItemViewGetItemsRangeP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ ItemRange itemRange(0, 0);
+
+ view.GetItemsRange(itemRange);
+
+ DALI_TEST_CHECK(itemRange.Within(0));
+ END_TEST;
+}
+
+int UtcDaliItemViewSetItemsAnchorPointP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
+
+ view.SetItemsAnchorPoint(anchorPoint);
+
+ DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentAnchorPoint() == anchorPoint);
+ END_TEST;
+}
+
+int UtcDaliItemViewSetItemsParentOriginP(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+
+ // Create a grid layout and add it to ItemView
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ view.AddLayout(*gridLayout);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
+
+ view.SetItemsParentOrigin(parentOrigin);
+
+ DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentParentOrigin() == parentOrigin);
+ END_TEST;
+}
} //namespace
+int UtcDaliPushButtonConstructorP(void)
+{
+ TestApplication application;
+
+ PushButton button;
+
+ DALI_TEST_CHECK( !button );
+ END_TEST;
+}
+
+int UtcDaliPushButtonCopyConstructorP(void)
+{
+ TestApplication application;
+
+ // Initialize an object, ref count == 1
+ PushButton button = PushButton::New();
+
+ PushButton copy( button );
+ DALI_TEST_CHECK( copy );
+ END_TEST;
+}
+
+int UtcDaliPushButtonAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ PushButton button = PushButton::New();
+
+ PushButton copy( button );
+ DALI_TEST_CHECK( copy );
+
+ DALI_TEST_CHECK( button == copy );
+ END_TEST;
+}
+
+int UtcDaliPushButtonNewP(void)
+{
+ TestApplication application;
+
+ PushButton button = PushButton::New();
+
+ DALI_TEST_CHECK( button );
+ END_TEST;
+}
+
+int UtcDaliPushButtonDownCastP(void)
+{
+ TestApplication application;
+
+ PushButton button = PushButton::New();
+
+ BaseHandle object(button);
+
+ PushButton button2 = PushButton::DownCast( object );
+ DALI_TEST_CHECK(button2);
+
+ PushButton button3 = DownCast< PushButton >(object);
+ DALI_TEST_CHECK(button3);
+ END_TEST;
+}
+
+int UtcDaliPushButtonDownCastN(void)
+{
+ TestApplication application;
+
+ BaseHandle unInitializedObject;
+
+ PushButton button1 = PushButton::DownCast( unInitializedObject );
+ DALI_TEST_CHECK( !button1 );
+
+ PushButton button2 = DownCast< PushButton >( unInitializedObject );
+ DALI_TEST_CHECK( !button2 );
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetButtonImage(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetButtonImage");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ application.SendNotification();
+ application.Render();
+
+ pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+ pushButton.SetButtonImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetButtonImage() );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 size = pushButton.GetCurrentSize();
+
+ DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+ pushButton.SetButtonImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetButtonImage() );
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetBackgroundImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetBackgroundImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetBackgroundImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
+
+ pushButton.SetBackgroundImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetSelectedImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetSelectedImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetSelectedImage() );
+
+ pushButton.SetSelectedImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetSelectedImage() );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetSelectedBackgroundImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetSelectedBackgroundImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
+
+ pushButton.SetSelectedBackgroundImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetDisabledBackgroundImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetDisabledBackgroundImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
+
+ pushButton.SetDisabledBackgroundImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonSetDisabledImageP");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+ ImageActor imageActor = CreateSolidColorActor( Color::RED );
+ imageActor.SetSize( 20, 20 );
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetDisabledImage( image );
+
+ DALI_TEST_CHECK( pushButton.GetDisabledImage() );
+
+ pushButton.SetDisabledImage( imageActor );
+
+ DALI_TEST_CHECK( pushButton.GetDisabledImage() );
+
+ END_TEST;
+}
int UtcDaliPushButtonSetGetAutoRepeating(void)
{
END_TEST;
}
-int UtcDaliPushButtonSetImages(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetImages");
-
- Actor imageActor;
-
- Image image01 = CreateSolidColorImage( Color::RED, 10, 10 );
-
- Vector3 size;
- PushButton pushButton = PushButton::New();
- Stage::GetCurrent().Add( pushButton );
-
- application.SendNotification();
- application.Render();
-
- pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
- pushButton.SetButtonImage( image01 );
-
- application.SendNotification();
- application.Render();
-
- size = pushButton.GetCurrentSize();
-
- DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
- END_TEST;
-}
-
int UtcDaliPushButtonSetLabelText(void)
{
ToolkitTestApplication application;
}
-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;
END_TEST;
}
-int UtcDaliRadioButtonDestructor(void)
+int UtcDaliRadioButtonDestructorP(void)
{
ToolkitTestApplication application;