stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c36c4e246ce9df19b6e2c2f88d394be388ac4012

commit c36c4e246ce9df19b6e2c2f88d394be388ac4012
Author: Oleksandr Shcherbina <o.shcherb...@samsung.com>
Date:   Thu Jan 14 11:51:45 2016 +0100

    eina_test: Add test-case for eina_quaternion_transform
    
    Reviewers: stefan_schmidt, cedric
    
    Subscribers: jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3568
---
 src/tests/eina/eina_test_quaternion.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/tests/eina/eina_test_quaternion.c 
b/src/tests/eina/eina_test_quaternion.c
index 901eac9..b3c133a 100644
--- a/src/tests/eina/eina_test_quaternion.c
+++ b/src/tests/eina/eina_test_quaternion.c
@@ -480,7 +480,7 @@ START_TEST(eina_test_quaternion_operations)
    Eina_Quaternion out;
    const double v[] = {0, 1, 2, 3};
    double angle;
-
+   Eina_Matrix4 m;
    eina_init();
 
    eina_quaternion_inverse(&out, &in);
@@ -511,6 +511,29 @@ START_TEST(eina_test_quaternion_operations)
    angle = eina_quaternion_angle_plains(&in, &in2);
    fail_if(angle - 0.963 > DBL_EPSILON);
 
+   eina_matrix4_values_set(&m,
+                           1, 0, 0, 0,
+                           0, 1, 0, 0,
+                           0, 0, 1, 0,
+                           0, 0, 0, 1);
+   eina_quaternion_transform(&out, &in, &m);
+   fail_if((fabs(out.x) - 2.0) > DBL_EPSILON ||
+           (fabs(out.y) - 2.0) > DBL_EPSILON ||
+           (fabs(out.z) - 1.0) > DBL_EPSILON ||
+           (fabs(out.w) - 1.0) > DBL_EPSILON
+          );
+
+   eina_matrix4_values_set(&m,
+                           0.5, 0, 0, 0,
+                           0, 0.5, 0, 0,
+                           0, 0, 1, 0,
+                           0, 0, 0, 1);
+   eina_quaternion_transform(&out, &in, &m);
+   fail_if((fabs(out.x) - 1.0) > DBL_EPSILON ||
+           (fabs(out.y) - 1.0) > DBL_EPSILON ||
+           (fabs(out.z) - 1.0) > DBL_EPSILON ||
+           (fabs(out.w) - 1.0) > DBL_EPSILON
+          );
    eina_shutdown();
 }
 END_TEST

-- 


Reply via email to