stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9e00bd01a138c40da89b7d90fc16a9205f660122

commit 9e00bd01a138c40da89b7d90fc16a9205f660122
Author: se.osadchy <se.osad...@samsung.com>
Date:   Wed Jan 13 13:46:49 2016 +0100

    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
---
 src/Makefile_Eina.am              |  1 +
 src/tests/eina/eina_suite.c       |  1 +
 src/tests/eina/eina_suite.h       |  1 +
 src/tests/eina/eina_test_vector.c | 49 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 52 insertions(+)

diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 46e8e0a..a0c4739 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 42b9006..b5c8759 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 b7f2726..7b05058 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 0000000..a45d1b5
--- /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);
+}

-- 


Reply via email to