memgraph/tests/unit/utils_timestamp.cpp
antonio2368 28413fd626 Change log library to spdlog, expose log levels to user (#72)
* Change from glog to spdlog

* Remove HA tests

* Remove logrotate log configuration

* Define custom main for unit gtests
2021-01-21 16:30:55 +01:00

26 lines
618 B
C++

#include <chrono>
#include <iostream>
#include <thread>
#include <gtest/gtest.h>
#include <utils/timestamp.hpp>
TEST(TimestampTest, BasicUsage) {
auto timestamp = utils::Timestamp::Now();
std::cout << timestamp << std::endl;
std::cout << utils::Timestamp::Now() << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(250));
std::cout << utils::Timestamp::Now().ToIso8601() << std::endl;
ASSERT_GT(utils::Timestamp::Now(), timestamp);
std::cout << std::boolalpha;
std::cout << (timestamp == utils::Timestamp::Now()) << std::endl;
ASSERT_NE(timestamp, utils::Timestamp::Now());
}