More tests.

This commit is contained in:
Victor Zverovich 2014-08-15 06:58:24 -07:00
parent d4412a01f0
commit c7cfa7d4e7
2 changed files with 9 additions and 1 deletions

View File

@ -374,10 +374,14 @@ TEST(WriterTest, WriteLongLong) {
TEST(WriterTest, WriteDouble) {
CHECK_WRITE(4.2);
CHECK_WRITE(-4.2);
CHECK_WRITE(std::numeric_limits<double>::min());
CHECK_WRITE(std::numeric_limits<double>::max());
}
TEST(WriterTest, WriteLongDouble) {
CHECK_WRITE(4.2l);
CHECK_WRITE(-4.2l);
CHECK_WRITE(std::numeric_limits<long double>::min());
CHECK_WRITE(std::numeric_limits<long double>::max());
}

View File

@ -362,7 +362,11 @@ TEST(PrintfTest, Length) {
TestLength<intmax_t>("j");
TestLength<std::size_t>("z");
TestLength<std::ptrdiff_t>("t");
// TODO: test 'L' & 'll'
long double max = std::numeric_limits<long double>::max();
EXPECT_PRINTF(fmt::format("{}", max), "%g", max);
EXPECT_PRINTF(fmt::format("{}", max), "%Lg", max);
EXPECT_GT(sizeof(fmt::LongLong), sizeof(int));
// TODO: test 'L'
}
// TODO: test type specifier