From a62c660ad54f7521a8f111c9035d95d09edd1129 Mon Sep 17 00:00:00 2001 From: rbock Date: Tue, 29 Jul 2014 18:18:57 +0200 Subject: [PATCH] Added some tvin-tests --- tests/FunctionTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/FunctionTest.cpp b/tests/FunctionTest.cpp index e668a668..18eddde1 100644 --- a/tests/FunctionTest.cpp +++ b/tests/FunctionTest.cpp @@ -389,5 +389,20 @@ int main() static_assert(sqlpp::is_alias_t::value, "type requirement"); } + // test tvin + { + static_assert(std::is_same>::value, "integral values are accepted and wrapped") ; + static_assert(std::is_same>::value, "bool values are accepted and wrapped") ; + static_assert(std::is_same>::value, "float values are accepted and wrapped") ; + static_assert(std::is_same>::value, "text values are accepted and wrapped") ; + + for (const auto& row : db(select(all_of(t)).from(t).where(true))) + { + static_assert(std::is_same>::value, "result fields are accepted and not wrapped") ; + static_assert(std::is_same>::value, "result fields are accepted and not wrapped") ; + static_assert(std::is_same>::value, "result fields are accepted and not wrapped") ; + } + } + return 0; }