X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-LongPressGestureDetector.cpp;h=2f2761ff458af37edf0c7db3417d4eb335c750e6;hb=23757de09d484bd019f758bc3a20e60e26a79456;hp=3fbf4250559bed407b611667f7448d401f77885b;hpb=4201fc9ccb4f5a06b44cd45407e6f3c8c6bd449c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp index 3fbf425..2f2761f 100644 --- a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp @@ -74,7 +74,7 @@ struct GestureReceivedFunctor { GestureReceivedFunctor(SignalData& data) : signalData(data) { } - void operator()(Actor actor, LongPressGesture longPress) + void operator()(Actor actor, const LongPressGesture& longPress) { signalData.functorCalled = true; signalData.receivedGesture = longPress; @@ -98,7 +98,7 @@ struct UnstageActorFunctor : public GestureReceivedFunctor { } - void operator()( Actor actor, LongPressGesture longPress ) + void operator()( Actor actor, const LongPressGesture& longPress ) { GestureReceivedFunctor::operator()( actor, longPress ); @@ -147,7 +147,7 @@ Integration::LongPressGestureEvent GenerateLongPress( // Positive test case for a method -int UtcDaliLongPressGestureDetectorConstructor(void) +int UtcDaliLongPressGestureDetectorConstructorP(void) { TestApplication application; @@ -156,6 +156,31 @@ int UtcDaliLongPressGestureDetectorConstructor(void) END_TEST; } +int UtcDaliLongPressGestureDetectorCopyConstructorP(void) +{ + TestApplication application; + + LongPressGestureDetector detector = LongPressGestureDetector::New();; + + LongPressGestureDetector copy( detector ); + DALI_TEST_CHECK( detector ); + END_TEST; +} + +int UtcDaliLongPressGestureDetectorAssignmentOperatorP(void) +{ + TestApplication application; + + LongPressGestureDetector detector; + detector = LongPressGestureDetector::New();; + + LongPressGestureDetector copy; + copy = detector; + DALI_TEST_CHECK( detector ); + + DALI_TEST_CHECK( detector == copy ); + END_TEST; +} int UtcDaliLongPressGestureDetectorNew(void) { @@ -198,7 +223,10 @@ int UtcDaliLongPressGestureDetectorNew(void) actor.TouchedSignal().Connect(&application, touchFunctor); Integration::TouchEvent touchEvent(1); - TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f); + Integration::Point point; + point.SetDeviceId( 1 ); + point.SetState( PointState::DOWN ); + point.SetScreenPosition( Vector2( 20.0f, 20.0f ) ); touchEvent.AddPoint(point); application.ProcessEvent(touchEvent); @@ -530,7 +558,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); Stage::GetCurrent().Add(actor); // Render and notify @@ -553,7 +581,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetRotation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); application.SendNotification(); application.Render(); @@ -567,7 +595,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetRotation(Dali::Degree(90.0f), Vector3::YAXIS); + actor.SetOrientation(Dali::Degree(90.0f), Vector3::YAXIS); application.SendNotification(); application.Render(); @@ -596,7 +624,7 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetAnchorPoint(AnchorPoint::CENTER); child.SetParentOrigin(ParentOrigin::CENTER); - child.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); parent.Add(child); TouchEventFunctor touchFunctor; @@ -944,7 +972,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateClear(void) } catch ( Dali::DaliException& e ) { - DALI_TEST_ASSERT( e, "false", TEST_LOCATION ); + DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION ); } END_TEST; } @@ -977,7 +1005,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateContinuing(void) } catch ( Dali::DaliException& e ) { - DALI_TEST_ASSERT( e, "false", TEST_LOCATION ); + DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION ); } END_TEST; } @@ -1314,7 +1342,7 @@ int UtcDaliLongPressGestureBehindTouchableSystemOverlay(void) touchData.Reset(); // Do touch in the same area - application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoords ) ); + application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) ); DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION ); @@ -1368,7 +1396,7 @@ int UtcDaliLongPressGestureTouchBehindGesturedSystemOverlay(void) touchData.Reset(); // Do touch in the same area - application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoords ) ); + application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) ); DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );