]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fixed formatting issue in humandate() test
authorLinux Karlsson <karlsson@ntp.org>
Tue, 15 Jun 2010 18:10:00 +0000 (14:10 -0400)
committerLinux Karlsson <karlsson@ntp.org>
Tue, 15 Jun 2010 18:10:00 +0000 (14:10 -0400)
bk: 4c17c1f8dr-L8YbUnKXZW8_jbs44CA

tests/libntp/humandate.cpp

index 4fb860978e32afe4b61699b99dfb35f2c47309a1..742aa28724ab8e6dd8ba24e19b4db960e7a3b484 100644 (file)
@@ -14,9 +14,10 @@ TEST_F(humandateTest, RegularTime) {
        time = localtime(&sample);
        ASSERT_TRUE(time != NULL);
 
-       expected << time->tm_hour << ":"
-                        << time->tm_min << ":"
-                        << time->tm_sec;
+       expected << std::setfill('0')
+                        << std::setw(2) << time->tm_hour << ":"
+                        << std::setw(2) << time->tm_min << ":"
+                        << std::setw(2) << time->tm_sec;
 
        EXPECT_STREQ(expected.str().c_str(), humantime(sample));
 }