summaryrefslogtreecommitdiff
path: root/src/tests/eolian_cxx/complex_cxx.cc
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 16:47:20 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 16:47:20 -0300
commit058f07e7596ae04a3594bb1b941298e9a22e45aa (patch)
tree87aa191060c4444b493a2ed70221950739f0464e /src/tests/eolian_cxx/complex_cxx.cc
parenta2d783a7c281239806e1cceed0970cc541585d5d (diff)
eolian-cxx: Added tests for wrapper conversion in C++ API
Diffstat (limited to '')
-rw-r--r--src/tests/eolian_cxx/complex_cxx.cc40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/tests/eolian_cxx/complex_cxx.cc b/src/tests/eolian_cxx/complex_cxx.cc
index 8b8d5e6286..b43e8be1ff 100644
--- a/src/tests/eolian_cxx/complex_cxx.cc
+++ b/src/tests/eolian_cxx/complex_cxx.cc
@@ -4,25 +4,37 @@
4#include "complex.eo.h" 4#include "complex.eo.h"
5#include "complex.eo.hh" 5#include "complex.eo.hh"
6 6
7template <typename T>
8struct test1;
9
10template <typename T, typename U> 7template <typename T, typename U>
11struct test1<void(T::*)(U) const> 8struct test_return_type;
9
10template <typename T, typename R, typename U>
11struct test_return_type<R(T::*)(), U>
12{ 12{
13 static_assert(std::is_same<efl::eina::range_list<int>, U>::value, "Wrong type"); 13 static_assert(std::is_same<R, U>::value, "Wrong type");
14};
15template <typename T, typename R, typename U>
16struct test_return_type<R(T::*)() const, U>
17{
18 static_assert(std::is_same<R, U>::value, "Wrong type");
14}; 19};
15
16template <typename T>
17struct test2;
18 20
19template <typename T, typename U> 21template <typename T, typename U>
20struct test2<U(T::*)() const> 22struct test_param_type;
23
24template <typename T, typename P, typename U>
25struct test_param_type<void(T::*)(P) const, U>
21{ 26{
22 static_assert(std::is_same<efl::eina::range_array<int>, U>::value, "Wrong type"); 27 static_assert(std::is_same<P, U>::value, "Wrong type");
28};
29template <typename T, typename P, typename U>
30struct test_param_type<void(T::*)(P), U>
31{
32 static_assert(std::is_same<P, U>::value, "Wrong type");
23}; 33};
24 34
25test1<typeof( & nonamespace::Complex::foo )> foo; 35test_param_type<typeof( & nonamespace::Complex::foo ), efl::eina::range_list<int>> foo;
26test2<typeof( & nonamespace::Complex::bar )> bar; 36test_return_type<typeof( & nonamespace::Complex::bar ), efl::eina::range_array<int>> bar;
27 37test_return_type<typeof( & nonamespace::Complex::wrapper_r ), nonamespace::Complex> wrapper_r;
28 38test_param_type<typeof( & nonamespace::Complex::wrapper_in ), nonamespace::Complex> wrapper_in;
39test_param_type<typeof( & nonamespace::Complex::wrapper_inout ), nonamespace::Complex*> wrapper_inout;
40test_param_type<typeof( & nonamespace::Complex::wrapper_out ), nonamespace::Complex*> wrapper_out;