Commit 99007fc3 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Fix Windows build

Summary: It was broken due to oddities with how MSVC handles expanding `##__VA_ARGS__` within the parameters to macros. Rather than deal with the pre-processor, just return the check to how it was and use `EXPECT_TRUE(false)` to achieve the same effect.

Reviewed By: yfeldblum

Differential Revision: D13850142

fbshipit-source-id: 887b39fb3c6072219c3f4748599bc7b707efbf25
parent f44d1a08
......@@ -36,15 +36,17 @@
* @param tolerance The tolerance, in milliseconds.
*/
#define T_CHECK_TIMEOUT(start, end, expectedMS, ...) \
EXPECT_TRUE(::folly::checkTimeout( \
(start), (end), (expectedMS), false, ##__VA_ARGS__)) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), false, ##__VA_ARGS__)) { \
ADD_FAILURE() \
<< "Timeout violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \
.count();
.count(); \
}
/**
* Verify that an event took less than a specified amount of time.
......@@ -53,12 +55,14 @@
* than the allowed time.
*/
#define T_CHECK_TIME_LT(start, end, expectedMS, ...) \
EXPECT_TRUE(::folly::checkTimeout( \
(start), (end), (expectedMS), true, ##__VA_ARGS__)) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), true, ##__VA_ARGS__)) { \
ADD_FAILURE() \
<< "Interval violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(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