diff options
author | Vivek Ellur <vivek.ellur@samsung.com> | 2015-06-04 10:32:01 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-06-04 10:32:18 +0200 |
commit | 81b52fb0ec452989e5f17072669bb8a1bb9b40a1 (patch) | |
tree | 60c5fb7990104fe96cd4c3573560940bc41e159d /src | |
parent | 408fc6237ea65a287331781312272e6a5974b156 (diff) |
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 <vivek.ellur@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2623
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/eina/eina_test_matrix.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 046876d2c4..28983e1b99 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) | |||
92 | } | 92 | } |
93 | END_TEST | 93 | END_TEST |
94 | 94 | ||
95 | START_TEST(eina_matrix3) | ||
96 | { | ||
97 | Eina_Bool ret; | ||
98 | Eina_Matrix3 m, m1, m2; | ||
99 | double xx, xy, xz, | ||
100 | yx, yy, yz, | ||
101 | zx, zy, zz; | ||
102 | |||
103 | eina_init(); | ||
104 | |||
105 | eina_matrix3_values_set(&m, | ||
106 | 1, 0, 0, | ||
107 | 0, 1, 0, | ||
108 | 0, 0, 1); | ||
109 | |||
110 | eina_matrix3_values_set(&m1, | ||
111 | 1, 0, 0, | ||
112 | 0, 1, 0, | ||
113 | 0, 0, 1); | ||
114 | |||
115 | eina_matrix3_values_set(&m2, | ||
116 | 1, 1, 1, | ||
117 | 0, 1, 0, | ||
118 | 0, 0, 1); | ||
119 | fail_if(eina_matrix3_type_get(&m) != EINA_MATRIX_TYPE_IDENTITY); | ||
120 | |||
121 | eina_matrix3_values_get(&m, | ||
122 | &xx, &xy, &xz, | ||
123 | &yx, &yy, &yz, | ||
124 | &zx, &zy, &zz); | ||
125 | |||
126 | fail_if(xx != yy || | ||
127 | yy != zz || | ||
128 | zz != 1); | ||
129 | |||
130 | fail_if(xy != xz || | ||
131 | yx != yz || | ||
132 | zx != zy || | ||
133 | zy != 0); | ||
134 | |||
135 | ret = eina_matrix3_equal(&m, &m1); | ||
136 | fail_if(ret != EINA_TRUE); | ||
137 | |||
138 | ret = eina_matrix3_equal(&m1, &m2); | ||
139 | fail_if(ret != EINA_FALSE); | ||
140 | |||
141 | eina_shutdown(); | ||
142 | } | ||
143 | END_TEST | ||
144 | |||
95 | void | 145 | void |
96 | eina_test_matrix(TCase *tc) | 146 | eina_test_matrix(TCase *tc) |
97 | { | 147 | { |
98 | tcase_add_test(tc, eina_matrix4); | 148 | tcase_add_test(tc, eina_matrix4); |
99 | tcase_add_test(tc, eina_matrix4_2_3); | 149 | tcase_add_test(tc, eina_matrix4_2_3); |
150 | tcase_add_test(tc, eina_matrix3); | ||
100 | } | 151 | } |