forked from enlightenment/efl
eina: add test case for eina_vector2
Summary: Create eina_test_vector and add first test case. Reviewers: cedric, stefan_schmidt Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3560
This commit is contained in:
parent
efc5866ddb
commit
9e00bd01a1
|
@ -321,6 +321,7 @@ tests/eina/eina_test_crc.c \
|
|||
tests/eina/eina_test_quad.c \
|
||||
tests/eina/eina_test_matrix.c \
|
||||
tests/eina/eina_test_quaternion.c \
|
||||
tests/eina/eina_test_vector.c \
|
||||
tests/eina/eina_test_bezier.c
|
||||
|
||||
tests_eina_eina_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
|
||||
|
|
|
@ -83,6 +83,7 @@ static const Eina_Test_Case etc[] = {
|
|||
{ "Quad", eina_test_quad },
|
||||
{ "Matrix", eina_test_matrix },
|
||||
{ "Quaternion", eina_test_quaternion },
|
||||
{ "Vector", eina_test_vector },
|
||||
{ "Bezier", eina_test_bezier },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
|
|
@ -68,6 +68,7 @@ void eina_test_crc(TCase *tc);
|
|||
void eina_test_quad(TCase *tc);
|
||||
void eina_test_matrix(TCase *tc);
|
||||
void eina_test_quaternion(TCase *tc);
|
||||
void eina_test_vector(TCase *tc);
|
||||
void eina_test_bezier(TCase *tc);
|
||||
|
||||
#endif /* EINA_SUITE_H_ */
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* EINA - EFL data type library
|
||||
* Copyright (C) 2016 Sergey Osadchy
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library;
|
||||
* if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "eina_suite.h"
|
||||
#include "Eina.h"
|
||||
|
||||
START_TEST(eina_test_vector_operations)
|
||||
{
|
||||
Eina_Vector2 out;;
|
||||
double x = 1;
|
||||
double y = 2;
|
||||
|
||||
eina_init();
|
||||
|
||||
eina_vector2_set(&out, x, y);
|
||||
fail_if((out.x != 1) || (out.y != 2));
|
||||
|
||||
eina_shutdown();
|
||||
}
|
||||
END_TEST
|
||||
|
||||
void
|
||||
eina_test_vector(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, eina_test_vector_operations);
|
||||
}
|
Loading…
Reference in New Issue