Commit 0e818b2e authored by Stepan Palamarchuk's avatar Stepan Palamarchuk Committed by Facebook Github Bot

Add duration_cast when printing expected ms

Summary: As per Yedidya Feldblum comment on my previous diff, we need a duration cast in here.

Reviewed By: yfeldblum

Differential Revision: D13833032

fbshipit-source-id: 8819694875bd3a7e4f54102d8ac77490f8287fbb
parent 4fd1f3ad
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
#define T_CHECK_TIMEOUT(start, end, expectedMS, ...) \ #define T_CHECK_TIMEOUT(start, end, expectedMS, ...) \
EXPECT_TRUE(::folly::checkTimeout( \ EXPECT_TRUE(::folly::checkTimeout( \
(start), (end), (expectedMS), false, ##__VA_ARGS__)) \ (start), (end), (expectedMS), false, ##__VA_ARGS__)) \
<< "Timeout violates constraints, expectedMs = " << (expectedMS).count() \ << "Timeout violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \ << ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \ << std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \ (end).getTime() - (start).getTime()) \
...@@ -54,7 +56,9 @@ ...@@ -54,7 +56,9 @@
EXPECT_TRUE(::folly::checkTimeout( \ EXPECT_TRUE(::folly::checkTimeout( \
(start), (end), (expectedMS), true, ##__VA_ARGS__)) \ (start), (end), (expectedMS), true, ##__VA_ARGS__)) \
<< "Interval violates constraints, expectedMs = " \ << "Interval violates constraints, expectedMs = " \
<< (expectedMS).count() << ", elapsed wall time ms = " \ << std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \ << std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \ (end).getTime() - (start).getTime()) \
.count(); .count();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment