Add more debug

This commit is contained in:
Krystian Stasiowski
2020-02-22 21:44:34 -05:00
parent cd70147c7d
commit c0b78c7698
2 changed files with 47 additions and 45 deletions

View File

@ -3680,66 +3680,66 @@ testGeneral()
void
testToStaticString()
{
BOOST_TEST(testTS(0, "0", L"0", true));
BOOST_TEST(testTS(0u, "0", L"0", true));
BOOST_TEST(testTS(0xffff, "65535", L"65535", true));
BOOST_TEST(testTS(0x10000, "65536", L"65536", true));
BOOST_TEST(testTS(0xffffffff, "4294967295", L"4294967295", true));
BOOST_TEST(testTS(-65535, "-65535", L"-65535", true));
BOOST_TEST(testTS(-65536, "-65536", L"-65536", true));
BOOST_TEST(testTS(-4294967295ll, "-4294967295", L"-4294967295", true));
BOOST_TEST(testTS(1, "1", L"1", true));
BOOST_TEST(testTS(-1, "-1", L"-1", true));
BOOST_TEST(testTS(0.1));
BOOST_TEST(testTS(0.0000001));
BOOST_TEST(testTS(-0.0000001));
BOOST_TEST(testTS(-0.1));
BOOST_TEST(testTS(1234567890.0001));
BOOST_TEST(testTS(1.123456789012345));
BOOST_TEST(testTS(-1234567890.1234));
BOOST_TEST(testTS(-1.123456789012345));
//BOOST_TEST(testTS(0, "0", L"0", true));
//BOOST_TEST(testTS(0u, "0", L"0", true));
//BOOST_TEST(testTS(0xffff, "65535", L"65535", true));
//BOOST_TEST(testTS(0x10000, "65536", L"65536", true));
//BOOST_TEST(testTS(0xffffffff, "4294967295", L"4294967295", true));
//BOOST_TEST(testTS(-65535, "-65535", L"-65535", true));
//BOOST_TEST(testTS(-65536, "-65536", L"-65536", true));
//BOOST_TEST(testTS(-4294967295ll, "-4294967295", L"-4294967295", true));
//BOOST_TEST(testTS(1, "1", L"1", true));
//BOOST_TEST(testTS(-1, "-1", L"-1", true));
//BOOST_TEST(testTS(0.1));
//BOOST_TEST(testTS(0.0000001));
//BOOST_TEST(testTS(-0.0000001));
//BOOST_TEST(testTS(-0.1));
//BOOST_TEST(testTS(1234567890.0001));
//BOOST_TEST(testTS(1.123456789012345));
//BOOST_TEST(testTS(-1234567890.1234));
//BOOST_TEST(testTS(-1.123456789012345));
BOOST_TEST(testTS(std::numeric_limits<long long>::max()));
BOOST_TEST(testTS(std::numeric_limits<long long>::min()));
BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
BOOST_TEST(testTS(std::numeric_limits<long double>::min()));
BOOST_TEST(testTS(std::numeric_limits<float>::min()));
// these tests technically are not portable, but they will work
// 99% of the time.
{
auto str = to_static_string(std::numeric_limits<float>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == "infinity" || str == "inf");
}
{
auto str = to_static_string(std::numeric_limits<double>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == "infinity" || str == "inf");
}
{
auto str = to_static_string(std::numeric_limits<long double>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == "infinity" || str == "inf");
}
//BOOST_TEST(testTS(std::numeric_limits<long long>::max()));
//BOOST_TEST(testTS(std::numeric_limits<long long>::min()));
//BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
//BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
//BOOST_TEST(testTS(std::numeric_limits<long double>::min()));
//BOOST_TEST(testTS(std::numeric_limits<float>::min()));
//
//// these tests technically are not portable, but they will work
//// 99% of the time.
//{
// auto str = to_static_string(std::numeric_limits<float>::max());
// BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
// static_string<0>::npos || str == "infinity" || str == "inf");
//}
//{
// auto str = to_static_string(std::numeric_limits<double>::max());
// BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
// static_string<0>::npos || str == "infinity" || str == "inf");
//}
//{
// auto str = to_static_string(std::numeric_limits<long double>::max());
// BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
// static_string<0>::npos || str == "infinity" || str == "inf");
//}
{
auto str = to_static_wstring(std::numeric_limits<float>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == L"infinity" || str == L"inf");
std::wcout << str;
std::wcout << str << '\n';
}
{
auto str = to_static_wstring(std::numeric_limits<double>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == L"infinity" || str == L"inf");
std::wcout << str;
std::wcout << str << '\n';
}
{
auto str = to_static_wstring(std::numeric_limits<long double>::max());
BOOST_TEST(str.find('e') != static_string<0>::npos || str.find('.') !=
static_string<0>::npos || str == L"infinity" || str == L"inf");
std::wcout << str;
std::wcout << str << '\n';
}
}