stefan pushed a commit to branch master.

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

commit f2e9a29a0db920c2bdef151f45c448fc8cb0b52e
Author: Oleksandr Shcherbina <o.shcherb...@samsung.com>
Date:   Wed Jan 13 14:14:50 2016 +0100

    eina: Add test-case for eina_normal3_matrix_get
    
    Summary: Test case fail, need apply that D3563
    
    Reviewers: cedric, Hermet, stefan_schmidt
    
    Subscribers: jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3564
---
 src/tests/eina/eina_test_matrix.c | 48 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/src/tests/eina/eina_test_matrix.c 
b/src/tests/eina/eina_test_matrix.c
index 50323fb..cac2163 100644
--- a/src/tests/eina/eina_test_matrix.c
+++ b/src/tests/eina/eina_test_matrix.c
@@ -715,6 +715,53 @@ START_TEST(eina_matrix3_map_transform)
 }
 END_TEST
 
+START_TEST(eina_normal3_test)
+{
+   Eina_Matrix3 out;
+   Eina_Matrix4 m;
+   double xx, xy, xz,
+          yx, yy, yz,
+          zx, zy, zz;
+
+   eina_init();
+   eina_matrix4_values_set(&m,
+                           1, 0, 0, 0,
+                           0, 1, 0, 0,
+                           0, 0, 1, 0,
+                           0, 0, 0, 1);
+   eina_normal3_matrix_get(&out, &m);
+   eina_matrix3_values_get(&out,
+                           &xx, &xy, &xz,
+                           &yx, &yy, &yz,
+                           &zx, &zy, &zz
+                           );
+
+   fail_if((fabs(xy) - 1.0) > DBL_EPSILON ||
+           (fabs(yx) - 1.0) > DBL_EPSILON ||
+           (fabs(yz) - 1.0) > DBL_EPSILON ||
+           (fabs(zy) - 1.0) > DBL_EPSILON
+          );
+
+   eina_matrix4_values_set(&m,
+                           0, 0, 0, 0,
+                           0, 1, 0, 0,
+                           0, 0, 0, 0,
+                           0, 0, 0, 1);
+   eina_normal3_matrix_get(&out, &m);
+   eina_matrix3_values_get(&out,
+                           &xx, &xy, &xz,
+                           &yx, &yy, &yz,
+                           &zx, &zy, &zz
+                           );
+   fail_if((fabs(xy)) > DBL_EPSILON ||
+           (fabs(yx)) > DBL_EPSILON ||
+           (fabs(yz)) > DBL_EPSILON ||
+           (fabs(zy)) > DBL_EPSILON
+          );
+   eina_shutdown();
+}
+END_TEST
+
 void
 eina_test_matrix(TCase *tc)
 {
@@ -727,4 +774,5 @@ eina_test_matrix(TCase *tc)
    tcase_add_test(tc, eina_matrix3_operations);
    tcase_add_test(tc, eina_matrix3_f16p16);
    tcase_add_test(tc, eina_matrix3_map_transform);
+   tcase_add_test(tc, eina_normal3_test);
 }

-- 


Reply via email to