aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-08-17 11:55:00 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-08-17 11:55:00 +0200
commit89c01a494aff2bd03b48a9858eed95a4a7ce9556 (patch)
treeda45a698d058a84ec15c80d3146e5fe7b3cb64da /test
parent687bedfcadc0e30cba63539a2d6b3c2315ea4f0a (diff)
Add unit test for has_ReturnType
Diffstat (limited to 'test')
-rw-r--r--test/meta.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/meta.cpp b/test/meta.cpp
index b8dea68e8..bd505762e 100644
--- a/test/meta.cpp
+++ b/test/meta.cpp
@@ -15,6 +15,10 @@ bool check_is_convertible(const From&, const To&)
return internal::is_convertible<From,To>::value;
}
+struct FooReturnType {
+ typedef int ReturnType;
+};
+
void test_meta()
{
VERIFY((internal::conditional<(3<4),internal::true_type, internal::false_type>::type::value));
@@ -75,6 +79,11 @@ void test_meta()
VERIFY((!check_is_convertible(A*B, f) ));
VERIFY(( check_is_convertible(A*B, A) ));
}
+
+ VERIFY(( internal::has_ReturnType<FooReturnType>::value ));
+ VERIFY(( internal::has_ReturnType<ScalarBinaryOpTraits<int,int> >::value ));
+ VERIFY(( !internal::has_ReturnType<MatrixXf>::value ));
+ VERIFY(( !internal::has_ReturnType<int>::value ));
VERIFY(internal::meta_sqrt<1>::ret == 1);
#define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt<X>::ret == int(std::sqrt(double(X))))