cedric pushed a commit to branch master.

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

commit 81b52fb0ec452989e5f17072669bb8a1bb9b40a1
Author: Vivek Ellur <[email protected]>
Date:   Thu Jun 4 10:32:01 2015 +0200

    eina: add test cases for eina_matrix3 APIs
    
    Summary:
    Added test cases for eina_matrix3_values_get, eina_matrix3_values_set,
    eina_matrix3_equal, eina_matrix3_type_get APIs
    
    Signed-off-by: Vivek Ellur <[email protected]>
    
    Reviewers: cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2623
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/tests/eina/eina_test_matrix.c | 51 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/src/tests/eina/eina_test_matrix.c 
b/src/tests/eina/eina_test_matrix.c
index 046876d..28983e1 100644
--- a/src/tests/eina/eina_test_matrix.c
+++ b/src/tests/eina/eina_test_matrix.c
@@ -92,9 +92,60 @@ START_TEST(eina_matrix4_2_3)
 }
 END_TEST
 
+START_TEST(eina_matrix3)
+{
+   Eina_Bool ret;
+   Eina_Matrix3 m, m1, m2;
+   double xx, xy, xz,
+          yx, yy, yz,
+          zx, zy, zz;
+
+          eina_init();
+
+   eina_matrix3_values_set(&m,
+                           1, 0, 0,
+                           0, 1, 0,
+                           0, 0, 1);
+
+   eina_matrix3_values_set(&m1,
+                           1, 0, 0,
+                           0, 1, 0,
+                           0, 0, 1);
+
+   eina_matrix3_values_set(&m2,
+                           1, 1, 1,
+                           0, 1, 0,
+                           0, 0, 1);
+   fail_if(eina_matrix3_type_get(&m) != EINA_MATRIX_TYPE_IDENTITY);
+
+   eina_matrix3_values_get(&m,
+                           &xx, &xy, &xz,
+                           &yx, &yy, &yz,
+                           &zx, &zy, &zz);
+
+   fail_if(xx != yy ||
+           yy != zz ||
+           zz != 1);
+
+   fail_if(xy != xz ||
+           yx != yz ||
+           zx != zy ||
+           zy != 0);
+
+   ret = eina_matrix3_equal(&m, &m1);
+   fail_if(ret != EINA_TRUE);
+
+   ret = eina_matrix3_equal(&m1, &m2);
+   fail_if(ret != EINA_FALSE);
+
+   eina_shutdown();
+}
+END_TEST
+
 void
 eina_test_matrix(TCase *tc)
 {
    tcase_add_test(tc, eina_matrix4);
    tcase_add_test(tc, eina_matrix4_2_3);
+   tcase_add_test(tc, eina_matrix3);
 }

-- 


Reply via email to