Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/topcpporg/cinatra
Browse files Browse the repository at this point in the history
  • Loading branch information
junjiexing committed Oct 16, 2015
2 parents 84722c8 + 517a22c commit 05421f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/cinatra/utils/aop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace cinatra
std::get<N>(aspects_).before(req, res, ctx);
invoke_before(req, res, ctx, Identity<N+1>());
}

void invoke_before(Request&, Response&, ContextContainer&, Identity<sizeof...(Aspect)>)
{
}
Expand All @@ -92,4 +93,4 @@ namespace cinatra
std::function<bool(Request&, Response&, ContextContainer&)> func_;
};

}
}
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SET(TEST_SOURCES
request_parser/request_parser.cpp
utils/case_map.cpp
utils/ncase_multi_map.cpp
utils/funtion_traits.cpp
response/response.cpp
router/router.cpp
string_utils/string_utils.cpp
Expand Down
11 changes: 11 additions & 0 deletions test/utils/funtion_traits.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <boost/test/unit_test.hpp>
#include <cinatra/utils/function_traits.hpp>

BOOST_AUTO_TEST_CASE(function_traits_test)
{
BOOST_CHECK(typeid(function_traits<int()>::return_type) == typeid(int));
BOOST_CHECK(typeid(function_traits<int(char)>::function_type) == typeid(int(char)));
BOOST_CHECK(function_traits<void(int, char)>::arity == 2);
BOOST_CHECK(typeid(function_traits<void(int, char)>::args<0>::type) == typeid(int));
BOOST_CHECK(typeid(function_traits<void(int, char)>::args<1>::type) == typeid(char));
}

0 comments on commit 05421f3

Please sign in to comment.