From c7cfa7d4e7df247a2f4e09405d3e48900a53aa31 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 15 Aug 2014 06:58:24 -0700 Subject: [PATCH] More tests. --- test/format-test.cc | 4 ++++ test/printf-test.cc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/format-test.cc b/test/format-test.cc index 84dd725e..d69fce55 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -374,10 +374,14 @@ TEST(WriterTest, WriteLongLong) { TEST(WriterTest, WriteDouble) { CHECK_WRITE(4.2); CHECK_WRITE(-4.2); + CHECK_WRITE(std::numeric_limits::min()); + CHECK_WRITE(std::numeric_limits::max()); } TEST(WriterTest, WriteLongDouble) { CHECK_WRITE(4.2l); + CHECK_WRITE(-4.2l); + CHECK_WRITE(std::numeric_limits::min()); CHECK_WRITE(std::numeric_limits::max()); } diff --git a/test/printf-test.cc b/test/printf-test.cc index adf8d927..dfb022b7 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -362,7 +362,11 @@ TEST(PrintfTest, Length) { TestLength("j"); TestLength("z"); TestLength("t"); - // TODO: test 'L' & 'll' + long double max = std::numeric_limits::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