mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-05 05:07:58 +08:00
28 lines
489 B
C++
28 lines
489 B
C++
#include <drogon/drogon_test.h>
|
|
|
|
namespace api
|
|
{
|
|
namespace v1
|
|
{
|
|
template <typename T>
|
|
class handler : public drogon::DrObject<T>
|
|
{
|
|
public:
|
|
static std::string name()
|
|
{
|
|
return handler<T>::classTypeName();
|
|
}
|
|
};
|
|
class hh : public handler<hh>
|
|
{
|
|
};
|
|
} // namespace v1
|
|
} // namespace api
|
|
|
|
DROGON_TEST(ClassName)
|
|
{
|
|
api::v1::hh h;
|
|
CHECK(h.className() == "api::v1::hh");
|
|
CHECK(api::v1::hh::classTypeName() == "api::v1::hh");
|
|
CHECK(h.name() == "api::v1::hh");
|
|
} |