| 216 | |
| 217 | template <typename T1, typename T2> |
| 218 | ::testing::AssertionResult AwaitAssertEq( |
| 219 | const char* expectedExpr, |
| 220 | const char* actualExpr, |
| 221 | const char* durationExpr, |
| 222 | const T1& expected, |
| 223 | const process::Future<T2>& actual, |
| 224 | const Duration& duration) |
| 225 | { |
| 226 | const ::testing::AssertionResult result = |
| 227 | AwaitAssertReady(actualExpr, durationExpr, actual, duration); |
| 228 | |
| 229 | if (result) { |
| 230 | if (expected == actual.get()) { |
| 231 | return ::testing::AssertionSuccess(); |
| 232 | } else { |
| 233 | return ::testing::AssertionFailure() |
| 234 | << "Value of: (" << actualExpr << ").get()\n" |
| 235 | << " Actual: " << ::testing::PrintToString(actual.get()) << "\n" |
| 236 | << "Expected: " << expectedExpr << "\n" |
| 237 | << "Which is: " << ::testing::PrintToString(expected); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | return result; |
| 242 | } |
| 243 | |
| 244 | |
| 245 | #define AWAIT_ASSERT_ABANDONED_FOR(actual, duration) \ |
nothing calls this directly
no test coverage detected