|
|
|
@ -145,6 +145,12 @@ TEST(TimeUtilTest, DurationIntegerConversion) { |
|
|
|
|
1, TimeUtil::DurationToMilliseconds(TimeUtil::MillisecondsToDuration(1))); |
|
|
|
|
EXPECT_EQ(-1, TimeUtil::DurationToMilliseconds( |
|
|
|
|
TimeUtil::MillisecondsToDuration(-1))); |
|
|
|
|
// Test overflow issue
|
|
|
|
|
EXPECT_EQ(315576000000000, TimeUtil::DurationToMilliseconds( |
|
|
|
|
TimeUtil::SecondsToDuration(315576000000))); |
|
|
|
|
// Test overflow issue
|
|
|
|
|
EXPECT_EQ(315576000000000000, TimeUtil::DurationToMicroseconds( |
|
|
|
|
TimeUtil::SecondsToDuration(315576000000))); |
|
|
|
|
EXPECT_EQ(1, TimeUtil::DurationToSeconds(TimeUtil::SecondsToDuration(1))); |
|
|
|
|
EXPECT_EQ(-1, TimeUtil::DurationToSeconds(TimeUtil::SecondsToDuration(-1))); |
|
|
|
|
EXPECT_EQ(1, TimeUtil::DurationToMinutes(TimeUtil::MinutesToDuration(1))); |
|
|
|
|