summaryrefslogtreecommitdiff
path: root/common/utils_unittest.cc
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2019-01-10 18:49:50 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-10 18:49:50 -0800
commit43e9d28ee2e46c19d9040ff65de954cedd55a61b (patch)
tree034171f68dc32eb9fe1a9d0af2829dfe2eb89790 /common/utils_unittest.cc
parentb2297a33d6f06804c4df3479be76e676850af0b2 (diff)
parent1b2d4b2e26fbf88e9ecfc92da499a00b8b238cb1 (diff)
Remove utils::TimeFromStructTimespec(). am: 1c3db7d742
am: 1b2d4b2e26 Change-Id: Ic672778baca971a6f82c03086fb70fab3ebe5a7a
Diffstat (limited to 'common/utils_unittest.cc')
-rw-r--r--common/utils_unittest.cc18
1 files changed, 0 insertions, 18 deletions
diff --git a/common/utils_unittest.cc b/common/utils_unittest.cc
index db885447..b30b2d2a 100644
--- a/common/utils_unittest.cc
+++ b/common/utils_unittest.cc
@@ -287,24 +287,6 @@ TEST(UtilsTest, FormatTimeDeltaTest) {
"-1s");
}
-TEST(UtilsTest, TimeFromStructTimespecTest) {
- struct timespec ts;
-
- // Unix epoch (Thursday 00:00:00 UTC on Jan 1, 1970)
- ts = (struct timespec) {.tv_sec = 0, .tv_nsec = 0};
- EXPECT_EQ(base::Time::UnixEpoch(), utils::TimeFromStructTimespec(&ts));
-
- // 42 ms after the Unix billennium (Sunday 01:46:40 UTC on September 9, 2001)
- ts = (struct timespec) {.tv_sec = 1000 * 1000 * 1000,
- .tv_nsec = 42 * 1000 * 1000};
- base::Time::Exploded exploded = (base::Time::Exploded) {
- .year = 2001, .month = 9, .day_of_week = 0, .day_of_month = 9,
- .hour = 1, .minute = 46, .second = 40, .millisecond = 42};
- base::Time time;
- EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &time));
- EXPECT_EQ(time, utils::TimeFromStructTimespec(&ts));
-}
-
TEST(UtilsTest, ConvertToOmahaInstallDate) {
// The Omaha Epoch starts at Jan 1, 2007 0:00 PST which is a
// Monday. In Unix time, this point in time is easily obtained via