From ddd087d8d1670aa6a9284ae2a4fefdedcddee07a Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 13 Aug 2014 06:42:15 -0700 Subject: [PATCH] Test more length specifiers. --- test/printf-test.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/printf-test.cc b/test/printf-test.cc index fc4b6234..b5cc96ec 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -333,8 +333,10 @@ void TestLength(const char *length_spec) { TestLength(length_spec, -42); TestLength(length_spec, min); TestLength(length_spec, max); - TestLength(length_spec, fmt::LongLong(min) - 1); - TestLength(length_spec, fmt::LongLong(max) + 1); + if (min > std::numeric_limits::min()) + TestLength(length_spec, fmt::LongLong(min) - 1); + if (max < std::numeric_limits::max()) + TestLength(length_spec, fmt::LongLong(max) + 1); TestLength(length_spec, std::numeric_limits::min()); TestLength(length_spec, std::numeric_limits::max()); TestLength(length_spec, std::numeric_limits::min()); @@ -355,9 +357,10 @@ TEST(PrintfTest, Length) { TestLength("h"); TestLength("l"); TestLength("l"); - // TODO: more tests - //EXPECT_EQ("-1", sprintf_int("%hhd", UCHAR_MAX)); - //EXPECT_EQ("255", sprintf_int("%hhu", UCHAR_MAX)); + TestLength("j"); + TestLength("z"); + TestLength("t"); + // TODO: test 'L' & 'll' } // TODO: test type specifier