Don't use CountDigits for 1-2 digit numbers.

This commit is contained in:
Victor Zverovich
2014-02-20 21:05:46 -08:00
parent 7abd6443ac
commit 86574285cc
2 changed files with 13 additions and 1 deletions
+2
View File
@@ -1459,6 +1459,8 @@ TEST(FormatIntTest, FormatDec) {
std::ostringstream os;
os << std::numeric_limits<unsigned short>::max();
EXPECT_EQ(os.str(), FormatDec(std::numeric_limits<unsigned short>::max()));
EXPECT_EQ("1", FormatDec(1));
EXPECT_EQ("-1", FormatDec(-1));
EXPECT_EQ("42", FormatDec(42));
EXPECT_EQ("-42", FormatDec(-42));
EXPECT_EQ("42", FormatDec(42l));