eina: add test case for eina_vector2
authorse.osadchy <se.osadchy@samsung.com>
Wed, 13 Jan 2016 12:46:49 +0000 (13:46 +0100)
committerStefan Schmidt <stefan@osg.samsung.com>
Wed, 13 Jan 2016 12:46:49 +0000 (13:46 +0100)
Summary: Create eina_test_vector and add first test case.

Reviewers: cedric, stefan_schmidt

Subscribers: jpeg

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

src/Makefile_Eina.am
src/tests/eina/eina_suite.c
src/tests/eina/eina_suite.h
src/tests/eina/eina_test_vector.c [new file with mode: 0644]

index 46e8e0a..a0c4739 100644 (file)
@@ -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 \
index 42b9006..b5c8759 100644 (file)
@@ -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 }
 };
index b7f2726..7b05058 100644 (file)
@@ -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 (file)
index 0000000..a45d1b5
--- /dev/null
@@ -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);
+}