proxygen
TimeTest.cpp File Reference

Go to the source code of this file.

Functions

 TEST (TimeTest, GetDateTimeStr)
 

Function Documentation

TEST ( TimeTest  ,
GetDateTimeStr   
)

Definition at line 15 of file TimeTest.cpp.

References ASSERT_EQ, ASSERT_FALSE, folly::empty(), proxygen::getCurrentTime(), proxygen::getDateTimeStr(), now(), and folly::pushmi::__adl::tp.

15  {
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
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868