cedric pushed a commit to branch master.

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

commit 1155176aa50e3ecdaf7affaf0b86d4b1ffd51ce9
Author: Vivek Ellur <vivek.el...@samsung.com>
Date:   Mon Jun 29 14:24:21 2015 +0200

    eina: add quaternion test in eina suite and fix the test case errors
    
    Summary:
    Fixed eina_test_quaternion_conjugate and eina_test_quaternion_matrix which
    were failing and also added the quaternion test in eina suite
    
    Signed-off-by: Vivek Ellur <vivek.el...@samsung.com>
    
    Reviewers: cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2775
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/tests/eina/eina_suite.c           |  1 +
 src/tests/eina/eina_suite.h           |  1 +
 src/tests/eina/eina_test_quaternion.c | 10 +++++-----
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c
index 5383bb6..5caa536 100644
--- a/src/tests/eina/eina_suite.c
+++ b/src/tests/eina/eina_suite.c
@@ -82,6 +82,7 @@ static const Eina_Test_Case etc[] = {
    { "Crc", eina_test_crc },
    { "Quad", eina_test_quad },
    { "Matrix", eina_test_matrix },
+   { "Quaternion", eina_test_quaternion },
    { NULL, NULL }
 };
 
diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h
index d39254d..845ec9d 100644
--- a/src/tests/eina/eina_suite.h
+++ b/src/tests/eina/eina_suite.h
@@ -67,5 +67,6 @@ void eina_test_xattr(TCase *tc);
 void eina_test_crc(TCase *tc);
 void eina_test_quad(TCase *tc);
 void eina_test_matrix(TCase *tc);
+void eina_test_quaternion(TCase *tc);
 
 #endif /* EINA_SUITE_H_ */
diff --git a/src/tests/eina/eina_test_quaternion.c 
b/src/tests/eina/eina_test_quaternion.c
index 55e1c9f..9ca60d4 100644
--- a/src/tests/eina/eina_test_quaternion.c
+++ b/src/tests/eina/eina_test_quaternion.c
@@ -62,7 +62,7 @@ START_TEST(eina_test_quaternion_norm)
 
    eina_init();
 
-   fail_if(FLOAT_CMP(eina_quaternion_norm(&q), sqrt(51)));
+   fail_if(!FLOAT_CMP(eina_quaternion_norm(&q), sqrt(51)));
 
    eina_shutdown();
 }
@@ -71,7 +71,7 @@ END_TEST
 START_TEST(eina_test_quaternion_conjugate)
 {
    static const Eina_Quaternion q1 = { 1, -1, -1, 3 }, q2 = { 1, 3, 4, 3 };
-   static const Eina_Quaternion r1 = { 1, 1, 1, -3 }, r2 = { 1, -3, -4, -3 };
+   static const Eina_Quaternion r1 = { -1, 1, 1, 3 }, r2 = { -1, -3, -4, 3 };
    Eina_Quaternion t1, t2;
 
    eina_init();
@@ -90,9 +90,9 @@ START_TEST(eina_test_quaternion_matrix)
 {
    Eina_Quaternion q = { 7, 9, 5, 1 };
    Eina_Matrix3 m = {
-     104, 76, 8,
-     104, -8, -116,
-     -52, 136, -56
+     -211, 136, 52,
+     116, -147, 104,
+     88, 76, -259
    };
    Eina_Quaternion tq;
    Eina_Matrix3 tm;

-- 


Reply via email to