1
0
forked from boostorg/core

Add tests for all fundamental types

This commit is contained in:
Peter Dimov
2021-10-05 07:50:52 +03:00
parent cd1a8fd238
commit 4f6f7c3799
2 changed files with 56 additions and 5 deletions

View File

@ -267,6 +267,27 @@ template<class T> std::string type_name( tn_identity<T>, std::string const& suff
return typeid_name<T>() + suffix; return typeid_name<T>() + suffix;
} }
// integrals
inline std::string type_name( tn_identity<unsigned>, std::string const& suffix )
{
return "unsigned" + suffix;
}
#if defined(_MSC_VER)
inline std::string type_name( tn_identity<long long>, std::string const& suffix )
{
return "long long" + suffix;
}
inline std::string type_name( tn_identity<unsigned long long>, std::string const& suffix )
{
return "unsigned long long" + suffix;
}
#endif
// cv // cv
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900 #if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900

View File

@ -67,7 +67,42 @@ struct Ch
int main() int main()
{ {
TEST(signed char);
TEST(unsigned char);
TEST(short);
TEST(unsigned short);
TEST(int); TEST(int);
TEST(unsigned);
TEST(long);
TEST(unsigned long);
TEST(long long);
TEST(unsigned long long);
TEST(char);
TEST(wchar_t);
#if !defined(BOOST_NO_CXX11_CHAR16_T)
TEST(char16_t);
#endif
#if !defined(BOOST_NO_CXX11_CHAR16_T)
TEST(char32_t);
#endif
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
TEST(char8_t);
#endif
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
TEST(std::byte);
#endif
TEST(bool);
TEST(float);
TEST(double);
TEST(long double);
TEST(void);
TEST(void const);
TEST(void volatile);
TEST(void const volatile);
TEST(A); TEST(A);
TEST(B); TEST(B);
@ -94,11 +129,6 @@ int main()
#endif #endif
TEST(void);
TEST(void const);
TEST(void volatile);
TEST(void const volatile);
TEST(A*); TEST(A*);
TEST(B const* volatile*); TEST(B const* volatile*);