]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3944] Use C++ style comparison in boost_time_utils unit test.
authorMarcin Siodelski <marcin@isc.org>
Thu, 16 Jul 2015 14:15:01 +0000 (16:15 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 16 Jul 2015 14:15:01 +0000 (16:15 +0200)
src/lib/util/tests/boost_time_utils_unittest.cc

index bf4d4a9e6391f1b21b70d00c4aa33ab542249859..45da2130defee4ed001215dc9d73f55a90ee32d3 100644 (file)
@@ -33,7 +33,7 @@ TEST(BoostTimeUtilsTest, epoch) {
     time_t tepoch = 0;
     ptime pepoch = from_time_t(tepoch);
     string sepoch = ptimeToText(pepoch);
-    EXPECT_TRUE(strncmp(sepoch.c_str(), "1970-01-01 00:00:00.000", 23) == 0);
+    EXPECT_EQ("1970-01-01 00:00:00.000", sepoch.substr(0, 23));
 }
 
 // The 2015 Bastille day
@@ -42,5 +42,5 @@ TEST(BoostTimeUtilsTest, bastilleDay) {
        hours(12) + minutes(13) + seconds(14) + milliseconds(500);
     ptime pbast(date(2015, Jul, 14), tdbast);
     string sbast = ptimeToText(pbast);
-    EXPECT_TRUE(strncmp(sbast.c_str(), "2015-07-14 12:13:14.500", 23) == 0);
+    EXPECT_EQ("2015-07-14 12:13:14.500", sbast.substr(0, 23));
 }