proxygen
TimeTest.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
12 
13 using namespace proxygen;
14 
15 TEST(TimeTest, GetDateTimeStr) {
17 
18  SystemClock::time_point sys_tp{}; // epoch timepoint
19  SteadyClock::time_point tp = SteadyClock::now() +
20  std::chrono::duration_cast<SteadyClock::duration>(
21  sys_tp - SystemClock::now());
22  ASSERT_EQ("1970-01-01T00:00:00 +0000", getDateTimeStr(tp));
23 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
std::chrono::steady_clock::time_point now()
constexpr auto empty(C const &c) -> decltype(c.empty())
Definition: Access.h:55
std::string getDateTimeStr(const ASN1_TIME *const time)
Definition: Time.cpp:17
std::chrono::time_point< ClockType > getCurrentTime()
Definition: Time.h:41
TEST(TimeTest, GetDateTimeStr)
Definition: TimeTest.cpp:15
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868