aboutsummaryrefslogtreecommitdiffstats
path: root/test/base/timestamp.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-04-05 01:52:52 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-04-05 01:52:52 +0200
commit62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd (patch)
treed4c74b5ca58db570a7856e08abd736652d98b492 /test/base/timestamp.cpp
parentfe9648fa1cdc8f9cf5216a88fadb8b96604047fd (diff)
downloadusdx-62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd.tar.gz
usdx-62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd.tar.xz
usdx-62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd.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/base/timestamp.cpp')
-rw-r--r--test/base/timestamp.cpp9
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);
}
};