blob: 11dba36f599d9a3085310cfa80cf6ff09936b0e0 [file] [log] [blame]
mukesh agrawal2e84b4a2014-04-24 15:42:47 -07001// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/shill_time.h"
6
7#include <time.h>
8
9#include <gtest/gtest.h>
10
11using std::string;
12using testing::Test;
13
14namespace shill {
15
16class TimeTest : public Test {
17};
18
19TEST_F(TimeTest, FormatTime) {
20 const time_t kEpochStart = 0;
21 const char kEpochStartString[] = "1970-01-01T00:00:00.000000+0000";
22 struct tm epoch_start_tm;
23 gmtime_r(&kEpochStart, &epoch_start_tm);
24 EXPECT_EQ(kEpochStartString, Time::FormatTime(epoch_start_tm, 0));
25}
26
27} // namespace shill