diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2015-04-05 01:52:52 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2015-04-05 01:52:52 +0200 |
commit | 62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd (patch) | |
tree | d4c74b5ca58db570a7856e08abd736652d98b492 /test | |
parent | fe9648fa1cdc8f9cf5216a88fadb8b96604047fd (diff) | |
download | usdx-cpp.tar.gz usdx-cpp.tar.xz usdx-cpp.zip |
compat/chrono_literals: Add C++14 backport.cpp
Add user-defined literals for duration types (like the ones from C++14),
Because these are user-defined they start with an underscore.
Diffstat (limited to 'test')
-rw-r--r-- | test/base/timestamp.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/base/timestamp.cpp b/test/base/timestamp.cpp index 23ea3b04..87b8ef8f 100644 --- a/test/base/timestamp.cpp +++ b/test/base/timestamp.cpp @@ -24,6 +24,7 @@ #include <thread> #include "base/timestamp.hpp" +#include "utils/compat/chrono_literals.hpp" #include <cppunit/extensions/HelperMacros.h> #include <log4cpp/Category.hh> @@ -49,15 +50,15 @@ namespace usdx void testWaitShorter() { Timestamp t; - std::this_thread::sleep_for(std::chrono::milliseconds{500}); - CPPUNIT_ASSERT_EQUAL(t.since(std::chrono::milliseconds{600}), true); + std::this_thread::sleep_for(500_ms); + CPPUNIT_ASSERT_EQUAL(t.since(600_ms), true); } void testWaitLonger() { Timestamp t; - std::this_thread::sleep_for(std::chrono::milliseconds{500}); - CPPUNIT_ASSERT_EQUAL(t.since(std::chrono::milliseconds{400}), false); + std::this_thread::sleep_for(500_ms); + CPPUNIT_ASSERT_EQUAL(t.since(400_ms), false); } }; |