From: Vivek Ellur Date: Thu, 4 Jun 2015 08:32:01 +0000 (+0200) Subject: eina: add test cases for eina_matrix3 APIs X-Git-Tag: v1.15.0-alpha1~345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81b52fb0ec452989e5f17072669bb8a1bb9b40a1;p=platform%2Fupstream%2Fefl.git 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 Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2623 Signed-off-by: Cedric BAIL --- 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); }