summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-01-11 16:10:55 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-01-11 16:10:55 -0200
commit88cce73f90a9920e0dafe34f7b99dbd215c1d4ab (patch)
tree765c786cbf032a43c3ba84a945380d59642e4928
parent8f02187d7aad665af1df27b43cb4b8bb68e1124e (diff)
eina-cxx: Remove Eo classes defined manually
Use Eolian to generate the Eo classes for the tests. This should fix T2940. @fix
-rw-r--r--src/Makefile_Eina_Cxx.am25
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_accessor.cc22
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_ptrarray.cc54
-rw-r--r--src/tests/eina_cxx/eina_cxx_test_ptrlist.cc77
-rw-r--r--src/tests/eina_cxx/simple.c21
-rw-r--r--src/tests/eina_cxx/simple.eo8
6 files changed, 113 insertions, 94 deletions
diff --git a/src/Makefile_Eina_Cxx.am b/src/Makefile_Eina_Cxx.am
index e9f7c13..166429a 100644
--- a/src/Makefile_Eina_Cxx.am
+++ b/src/Makefile_Eina_Cxx.am
@@ -59,13 +59,33 @@ tests/eina_cxx/eina_cxx_test_error.cc \
59tests/eina_cxx/eina_cxx_test_accessor.cc \ 59tests/eina_cxx/eina_cxx_test_accessor.cc \
60tests/eina_cxx/eina_cxx_test_thread.cc \ 60tests/eina_cxx/eina_cxx_test_thread.cc \
61tests/eina_cxx/eina_cxx_test_optional.cc \ 61tests/eina_cxx/eina_cxx_test_optional.cc \
62tests/eina_cxx/eina_cxx_test_value.cc 62tests/eina_cxx/eina_cxx_test_value.cc \
63tests/eina_cxx/simple.c
63 64
64tests_eina_cxx_eina_cxx_suite_CXXFLAGS = -I$(top_builddir)/src/lib/efl \ 65tests/eina_cxx/tests_eina_cxx_eina_cxx_suite-eina_cxx_test_accessor.$(OBJEXT): tests/eina_cxx/simple.eo.hh tests/eina_cxx/simple.eo.h
66tests/eina_cxx/tests_eina_cxx_eina_cxx_suite-eina_cxx_test_ptrarray.$(OBJEXT): tests/eina_cxx/simple.eo.hh tests/eina_cxx/simple.eo.h
67tests/eina_cxx/tests_eina_cxx_eina_cxx_suite-eina_cxx_test_ptrlist.$(OBJEXT): tests/eina_cxx/simple.eo.hh tests/eina_cxx/simple.eo.h
68
69tests/eina_cxx/tests_eina_cxx_eina_cxx_suite-simple.$(OBJEXT): tests/eina_cxx/simple.eo.c tests/eina_cxx/simple.eo.h
70
71CLEANFILES += \
72tests/eina_cxx/simple.eo.c \
73tests/eina_cxx/simple.eo.h \
74tests/eina_cxx/simple.eo.hh \
75tests/eina_cxx/simple.eo.impl.hh
76
77EXTRA_DIST += \
78tests/eina_cxx/simple.eo
79
80tests_eina_cxx_eina_cxx_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
65-DTESTS_WD=\"`pwd`\" \ 81-DTESTS_WD=\"`pwd`\" \
66-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eina_cxx\" \ 82-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eina_cxx\" \
67-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eina_cxx\" \ 83-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eina_cxx\" \
68-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eina_cxx\" \ 84-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eina_cxx\" \
85-I$(top_builddir)/src/lib/efl \
86-I$(top_builddir)/src/lib/efl/interfaces \
87-I$(top_srcdir)/src/bin/eina_cxx \
88-I$(top_builddir)/src/tests/eina_cxx \
69@CHECK_CFLAGS@ \ 89@CHECK_CFLAGS@ \
70@EO_CFLAGS@ \ 90@EO_CFLAGS@ \
71@ECORE_CFLAGS@ \ 91@ECORE_CFLAGS@ \
@@ -76,4 +96,3 @@ tests_eina_cxx_eina_cxx_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_IN
76 96
77endif 97endif
78endif 98endif
79
diff --git a/src/tests/eina_cxx/eina_cxx_test_accessor.cc b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
index 39b85f0..af49fb9 100644
--- a/src/tests/eina_cxx/eina_cxx_test_accessor.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
@@ -10,9 +10,9 @@
10 10
11#include <check.h> 11#include <check.h>
12 12
13 13extern "C" {
14const Eo_Class *simple_class_get(void); 14#include "simple.eo.h"
15#define MY_CLASS simple_class_get() 15}
16 16
17struct wrapper : efl::eo::concrete 17struct wrapper : efl::eo::concrete
18{ 18{
@@ -46,10 +46,10 @@ START_TEST(eina_cxx_eo_accessor_indexing)
46 46
47 efl::eina::list<wrapper> list; 47 efl::eina::list<wrapper> list;
48 48
49 wrapper const w1(eo_add(MY_CLASS, NULL)); 49 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
50 wrapper const w2(eo_add(MY_CLASS, NULL)); 50 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
51 wrapper const w3(eo_add(MY_CLASS, NULL)); 51 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
52 wrapper const w4(eo_add(MY_CLASS, NULL)); 52 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
53 53
54 list.push_back(w1); 54 list.push_back(w1);
55 list.push_back(w2); 55 list.push_back(w2);
@@ -100,10 +100,10 @@ START_TEST(eina_cxx_eo_accessor_iterator)
100 100
101 efl::eina::list<wrapper> list; 101 efl::eina::list<wrapper> list;
102 102
103 wrapper const w1(eo_add(MY_CLASS, NULL)); 103 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
104 wrapper const w2(eo_add(MY_CLASS, NULL)); 104 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
105 wrapper const w3(eo_add(MY_CLASS, NULL)); 105 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
106 wrapper const w4(eo_add(MY_CLASS, NULL)); 106 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
107 107
108 list.push_back(w1); 108 list.push_back(w1);
109 list.push_back(w2); 109 list.push_back(w2);
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
index 67d4722..2bf8bb5 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
@@ -11,9 +11,9 @@
11#include <algorithm> 11#include <algorithm>
12 12
13#include <check.h> 13#include <check.h>
14 14extern "C" {
15const Eo_Class *simple_class_get(void); 15#include "simple.eo.h"
16#define MY_CLASS simple_class_get() 16}
17 17
18struct wrapper : efl::eo::concrete 18struct wrapper : efl::eo::concrete
19{ 19{
@@ -29,9 +29,9 @@ START_TEST(eina_cxx_ptrarray_push_back)
29 int result[] = {5, 10, 15}; 29 int result[] = {5, 10, 15};
30 int rresult[] = {15, 10, 5}; 30 int rresult[] = {15, 10, 5};
31 31
32 wrapper const w1(eo_add(MY_CLASS, NULL)); 32 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
33 wrapper const w2(eo_add(MY_CLASS, NULL)); 33 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
34 wrapper const w3(eo_add(MY_CLASS, NULL)); 34 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
35 35
36 { 36 {
37 efl::eina::ptr_array<int> array; 37 efl::eina::ptr_array<int> array;
@@ -105,9 +105,9 @@ START_TEST(eina_cxx_ptrarray_pop_back)
105 ck_assert(std::equal(array.rbegin(), array.rend(), rresult)); 105 ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
106 } 106 }
107 { 107 {
108 wrapper const w1(eo_add(MY_CLASS, NULL)); 108 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
109 wrapper const w2(eo_add(MY_CLASS, NULL)); 109 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
110 wrapper const w3(eo_add(MY_CLASS, NULL)); 110 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
111 111
112 efl::eina::array<wrapper> array; 112 efl::eina::array<wrapper> array;
113 113
@@ -200,11 +200,11 @@ START_TEST(eina_cxx_ptrarray_insert)
200 ck_assert(std::equal(array.begin(), array.end(), array4.begin())); 200 ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
201 } 201 }
202 { 202 {
203 wrapper const w0(eo_add(MY_CLASS, NULL)); 203 wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
204 wrapper const w1(eo_add(MY_CLASS, NULL)); 204 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
205 wrapper const w2(eo_add(MY_CLASS, NULL)); 205 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
206 wrapper const w3(eo_add(MY_CLASS, NULL)); 206 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
207 wrapper const w4(eo_add(MY_CLASS, NULL)); 207 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
208 208
209 efl::eina::array<wrapper> array; 209 efl::eina::array<wrapper> array;
210 ck_assert(std::distance(array.begin(), array.end()) == 0u); 210 ck_assert(std::distance(array.begin(), array.end()) == 0u);
@@ -280,7 +280,7 @@ START_TEST(eina_cxx_ptrarray_constructors)
280 efl::eina::eina_init eina_init; 280 efl::eina::eina_init eina_init;
281 efl::eo::eo_init eo_init; 281 efl::eo::eo_init eo_init;
282 282
283 wrapper const w1(eo_add(MY_CLASS, NULL)); 283 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
284 284
285 { 285 {
286 efl::eina::ptr_array<int> array1; 286 efl::eina::ptr_array<int> array1;
@@ -359,12 +359,12 @@ START_TEST(eina_cxx_ptrarray_erase)
359 ck_assert(array1.back() == 25); 359 ck_assert(array1.back() == 25);
360 } 360 }
361 { 361 {
362 wrapper const w1(eo_add(MY_CLASS, NULL)); 362 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
363 wrapper const w2(eo_add(MY_CLASS, NULL)); 363 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
364 wrapper const w3(eo_add(MY_CLASS, NULL)); 364 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
365 wrapper const w4(eo_add(MY_CLASS, NULL)); 365 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
366 wrapper const w5(eo_add(MY_CLASS, NULL)); 366 wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
367 wrapper const w6(eo_add(MY_CLASS, NULL)); 367 wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
368 368
369 efl::eina::array<wrapper> array1; 369 efl::eina::array<wrapper> array1;
370 370
@@ -440,12 +440,12 @@ START_TEST(eina_cxx_ptrarray_range)
440 } 440 }
441 441
442 { 442 {
443 wrapper const w1(eo_add(MY_CLASS, NULL)); 443 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
444 wrapper const w2(eo_add(MY_CLASS, NULL)); 444 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
445 wrapper const w3(eo_add(MY_CLASS, NULL)); 445 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
446 wrapper const w4(eo_add(MY_CLASS, NULL)); 446 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
447 wrapper const w5(eo_add(MY_CLASS, NULL)); 447 wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
448 wrapper const w6(eo_add(MY_CLASS, NULL)); 448 wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
449 449
450 efl::eina::array<wrapper> array; 450 efl::eina::array<wrapper> array;
451 array.push_back(w1); 451 array.push_back(w1);
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
index 35f2cef..281740d 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
@@ -13,39 +13,10 @@
13 13
14#include <check.h> 14#include <check.h>
15 15
16const Eo_Class *simple_class_get(void); 16extern "C" {
17#define MY_CLASS simple_class_get() 17#include "simple.eo.h"
18
19static Eo *
20_constructor(Eo *obj, void *class_data EINA_UNUSED)
21{
22 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
23}
24
25static void
26_destructor(Eo *obj, void *class_data EINA_UNUSED)
27{
28 eo_do_super(obj, MY_CLASS, eo_destructor());
29} 18}
30 19
31static Eo_Op_Description op_descs[] = {
32 EO_OP_FUNC_OVERRIDE(reinterpret_cast<void*>(&eo_constructor), reinterpret_cast<void*>(&_constructor))
33 , EO_OP_FUNC_OVERRIDE(reinterpret_cast<void*>(&eo_destructor), reinterpret_cast<void*>(&_destructor))
34};
35
36static const Eo_Class_Description class_desc = {
37 EO_VERSION,
38 "Simple",
39 EO_CLASS_TYPE_REGULAR,
40 EO_CLASS_DESCRIPTION_OPS(op_descs),
41 NULL,
42 0,
43 0,
44 0
45};
46
47EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, NULL);
48
49struct wrapper : efl::eo::concrete 20struct wrapper : efl::eo::concrete
50{ 21{
51 explicit wrapper(Eo* o) 22 explicit wrapper(Eo* o)
@@ -60,9 +31,9 @@ START_TEST(eina_cxx_ptrlist_push_back)
60 int result[] = {5, 10, 15}; 31 int result[] = {5, 10, 15};
61 int rresult[] = {15, 10, 5}; 32 int rresult[] = {15, 10, 5};
62 33
63 wrapper const w1(eo_add(MY_CLASS, NULL)); 34 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
64 wrapper const w2(eo_add(MY_CLASS, NULL)); 35 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
65 wrapper const w3(eo_add(MY_CLASS, NULL)); 36 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
66 37
67 { 38 {
68 efl::eina::ptr_list<int> list; 39 efl::eina::ptr_list<int> list;
@@ -109,9 +80,9 @@ START_TEST(eina_cxx_ptrlist_pop_back)
109 int result[] = {5, 10}; 80 int result[] = {5, 10};
110 int rresult[] = {10, 5}; 81 int rresult[] = {10, 5};
111 82
112 wrapper const w1(eo_add(MY_CLASS, NULL)); 83 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
113 wrapper const w2(eo_add(MY_CLASS, NULL)); 84 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
114 wrapper const w3(eo_add(MY_CLASS, NULL)); 85 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
115 86
116 { 87 {
117 efl::eina::ptr_list<int> list; 88 efl::eina::ptr_list<int> list;
@@ -175,9 +146,9 @@ START_TEST(eina_cxx_ptrlist_push_front)
175 ck_assert(std::equal(list.rbegin(), list.rend(), rresult)); 146 ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
176 } 147 }
177 { 148 {
178 wrapper const w1(eo_add(MY_CLASS, NULL)); 149 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
179 wrapper const w2(eo_add(MY_CLASS, NULL)); 150 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
180 wrapper const w3(eo_add(MY_CLASS, NULL)); 151 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
181 152
182 efl::eina::list<wrapper> list; 153 efl::eina::list<wrapper> list;
183 154
@@ -203,9 +174,9 @@ START_TEST(eina_cxx_ptrlist_pop_front)
203 int result[] = {10, 5}; 174 int result[] = {10, 5};
204 int rresult[] = {5, 10}; 175 int rresult[] = {5, 10};
205 176
206 wrapper const w1(eo_add(MY_CLASS, NULL)); 177 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
207 wrapper const w2(eo_add(MY_CLASS, NULL)); 178 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
208 wrapper const w3(eo_add(MY_CLASS, NULL)); 179 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
209 180
210 { 181 {
211 efl::eina::ptr_list<int> list; 182 efl::eina::ptr_list<int> list;
@@ -305,11 +276,11 @@ START_TEST(eina_cxx_ptrlist_insert)
305 ck_assert(std::equal(list.begin(), list.end(), list4.begin())); 276 ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
306 } 277 }
307 { 278 {
308 wrapper const w0(eo_add(MY_CLASS, NULL)); 279 wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
309 wrapper const w1(eo_add(MY_CLASS, NULL)); 280 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
310 wrapper const w2(eo_add(MY_CLASS, NULL)); 281 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
311 wrapper const w3(eo_add(MY_CLASS, NULL)); 282 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
312 wrapper const w4(eo_add(MY_CLASS, NULL)); 283 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
313 284
314 efl::eina::list<wrapper> list; 285 efl::eina::list<wrapper> list;
315 286
@@ -398,11 +369,11 @@ START_TEST(eina_cxx_ptrlist_constructors)
398 ck_assert(list2 == list4); 369 ck_assert(list2 == list4);
399 } 370 }
400 { 371 {
401 wrapper const w0(eo_add(MY_CLASS, NULL)); 372 wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
402 wrapper const w1(eo_add(MY_CLASS, NULL)); 373 wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
403 wrapper const w2(eo_add(MY_CLASS, NULL)); 374 wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
404 wrapper const w3(eo_add(MY_CLASS, NULL)); 375 wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
405 wrapper const w4(eo_add(MY_CLASS, NULL)); 376 wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
406 377
407 efl::eina::list<wrapper> list1; 378 efl::eina::list<wrapper> list1;
408 ck_assert(list1.empty()); 379 ck_assert(list1.empty());
diff --git a/src/tests/eina_cxx/simple.c b/src/tests/eina_cxx/simple.c
new file mode 100644
index 0000000..8a742e1
--- /dev/null
+++ b/src/tests/eina_cxx/simple.c
@@ -0,0 +1,21 @@
1
2#ifdef HAVE_CONFIG_H
3# include <config.h>
4#endif
5
6#include <Eo.h>
7#include <Ecore.h>
8
9#include <stdlib.h>
10
11#include "simple.eo.h"
12
13#define MY_CLASS SIMPLE_CLASS
14
15static Eo *_simple_eo_base_constructor(Eo *obj, void *pd EINA_UNUSED)
16{
17 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
18}
19
20#include "simple.eo.c"
21
diff --git a/src/tests/eina_cxx/simple.eo b/src/tests/eina_cxx/simple.eo
new file mode 100644
index 0000000..15aebec
--- /dev/null
+++ b/src/tests/eina_cxx/simple.eo
@@ -0,0 +1,8 @@
1class Simple (Eo.Base)
2{
3 legacy_prefix: null;
4 data: null;
5 implements {
6 Eo.Base.constructor;
7 }
8}