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.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2775

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Vivek Ellur 2015-06-29 14:24:21 +02:00 committed by Cedric BAIL
parent 947edc8471
commit 1155176aa5
3 changed files with 7 additions and 5 deletions

View File

@ -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 }
};

View File

@ -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_ */

View File

@ -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;