| 140 | |
| 141 | template <typename T> |
| 142 | ::testing::AssertionResult AwaitAssertFailed( |
| 143 | const char* expr, |
| 144 | const char*, // Unused string representation of 'duration'. |
| 145 | const process::Future<T>& actual, |
| 146 | const Duration& duration) |
| 147 | { |
| 148 | if (!process::internal::await(actual, duration)) { |
| 149 | return ::testing::AssertionFailure() |
| 150 | << "Failed to wait " << duration << " for " << expr; |
| 151 | } else if (actual.isDiscarded()) { |
| 152 | return ::testing::AssertionFailure() |
| 153 | << expr << " was discarded"; |
| 154 | } else if (actual.isReady()) { |
| 155 | return ::testing::AssertionFailure() |
| 156 | << expr << " is ready (" << ::testing::PrintToString(actual.get()) << ")"; |
| 157 | } |
| 158 | |
| 159 | return ::testing::AssertionSuccess(); |
| 160 | } |
| 161 | |
| 162 | |
| 163 | template <typename T> |
nothing calls this directly
no test coverage detected