diff options
author | se.osadchy <se.osadchy@samsung.com> | 2016-01-13 13:46:49 +0100 |
---|---|---|
committer | Stefan Schmidt <stefan@osg.samsung.com> | 2016-01-13 13:46:49 +0100 |
commit | 9e00bd01a138c40da89b7d90fc16a9205f660122 (patch) | |
tree | 021eca04b9b0d0283265259a4f8bfe350bcfbaed | |
parent | efc5866ddb568429eea41d741663f5cb0030eafe (diff) | |
download | efl-9e00bd01a138c40da89b7d90fc16a9205f660122.tar.gz |
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
-rw-r--r-- | src/Makefile_Eina.am | 1 | ||||
-rw-r--r-- | src/tests/eina/eina_suite.c | 1 | ||||
-rw-r--r-- | src/tests/eina/eina_suite.h | 1 | ||||
-rw-r--r-- | src/tests/eina/eina_test_vector.c | 49 |
4 files changed, 52 insertions, 0 deletions
diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am index 46e8e0a730..a0c4739865 100644 --- a/src/Makefile_Eina.am +++ b/src/Makefile_Eina.am @@ -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 \ diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c index 42b9006516..b5c8759988 100644 --- a/src/tests/eina/eina_suite.c +++ b/src/tests/eina/eina_suite.c @@ -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 } }; diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h index b7f2726e1d..7b050586fc 100644 --- a/src/tests/eina/eina_suite.h +++ b/src/tests/eina/eina_suite.h @@ -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_ */ diff --git a/src/tests/eina/eina_test_vector.c b/src/tests/eina/eina_test_vector.c new file mode 100644 index 0000000000..a45d1b5bdc --- /dev/null +++ b/src/tests/eina/eina_test_vector.c @@ -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); +} |