Implement additional UTC 37/42437/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Mon, 29 Jun 2015 07:36:24 +0000 (16:36 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Mon, 29 Jun 2015 07:38:05 +0000 (16:38 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: I36e35ea1675f6f34b7850cb19a8902e8c61e8741

automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-Rect.cpp
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp

index 32db45f0edb5c44abc3321a76bd5e8c7f047d049..0fd2325a979607dfaaa2c93677ee0ddd69f2919a 100644 (file)
@@ -1785,6 +1785,33 @@ int UtcDaliPanGestureAngleHandling(void)
   END_TEST;
 }
 
+int UtcDaliPanGestureGetAngle(void)
+{
+  TestApplication application;
+
+  PanGestureDetector detector = PanGestureDetector::New();
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_LEFT );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_UP );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 3, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_DOWN );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 4, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( detector.GetAngle(0).first,  PanGestureDetector::DIRECTION_LEFT, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(1).first,  PanGestureDetector::DIRECTION_RIGHT, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(2).first,  PanGestureDetector::DIRECTION_UP, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(3).first,  PanGestureDetector::DIRECTION_DOWN, TEST_LOCATION );
+
+  END_TEST;
+}
+
 inline float RadiansToDegrees( float radian )
 {
   return radian * 180.0f / Math::PI;
index 33938daa58cfff9ab1084b89ba18494134715223..708c25cb93f60dcb3f7b7312751780c1361c7882 100644 (file)
@@ -126,6 +126,16 @@ int UtcDaliRectIsEmpty(void)
   END_TEST;
 }
 
+int UtcDaliRectLeft(void)
+{
+  TestApplication application;
+
+  Rect<float> rf(10.0f, 20.0f, 400.0f, 200.0f);
+
+  DALI_TEST_EQUALS(rf.Left(), 10.0f, 0.001, TEST_LOCATION);
+  END_TEST;
+}
+
 int UtcDaliRectRight(void)
 {
   TestApplication application;
@@ -136,6 +146,15 @@ int UtcDaliRectRight(void)
   END_TEST;
 }
 
+int UtcDaliRectTop(void)
+{
+  TestApplication application;
+
+  Rect<float> rf(10.0f, 20.0f, 400.0f, 200.0f);
+
+  DALI_TEST_EQUALS(rf.Top(), 20.0f, 0.001, TEST_LOCATION);
+  END_TEST;
+}
 
 int UtcDaliRectBottom(void)
 {
index 8d09883b920577618d9b9161d0c974acd038a977..2fe2760aea660dfe7b9aee0923b2ab77125e634a 100644 (file)
@@ -152,33 +152,36 @@ int UtcDaliTouchNormalProcessing(void)
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  const TouchPoint *point1 = &data.touchEvent.GetPoint(0);
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
-  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
-  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
-  DALI_TEST_EQUALS( localCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, point1->state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point1->screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point1->local, 0.1f, TEST_LOCATION );
   data.Reset();
 
   // Emit a motion signal
   screenCoordinates.x = screenCoordinates.y = 11.0f;
   actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
   application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
+  const TouchPoint *point2 = &data.touchEvent.GetPoint(0);
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
-  DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
-  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
-  DALI_TEST_EQUALS( localCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, point2->state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point2->screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point2->local, 0.1f, TEST_LOCATION );
   data.Reset();
 
   // Emit an up signal
   screenCoordinates.x = screenCoordinates.y = 12.0f;
   actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
   application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
+  const TouchPoint *point3 = &data.touchEvent.GetPoint(0);
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
-  DALI_TEST_EQUALS( TouchPoint::Up, data.touchEvent.points[0].state, TEST_LOCATION );
-  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
-  DALI_TEST_EQUALS( localCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Up, point3->state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point3->screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point3->local, 0.1f, TEST_LOCATION );
   data.Reset();
 
   // Emit a down signal where the actor is not present