| 162 | |
| 163 | template <typename T> |
| 164 | ::testing::AssertionResult AwaitAssertDiscarded( |
| 165 | const char* expr, |
| 166 | const char*, // Unused string representation of 'duration'. |
| 167 | const process::Future<T>& actual, |
| 168 | const Duration& duration) |
| 169 | { |
| 170 | if (!process::internal::await(actual, duration)) { |
| 171 | return ::testing::AssertionFailure() |
| 172 | << "Failed to wait " << duration << " for " << expr; |
| 173 | } else if (actual.isFailed()) { |
| 174 | return ::testing::AssertionFailure() |
| 175 | << "(" << expr << ").failure(): " << actual.failure(); |
| 176 | } else if (actual.isReady()) { |
| 177 | return ::testing::AssertionFailure() |
| 178 | << expr << " is ready (" << ::testing::PrintToString(actual.get()) << ")"; |
| 179 | } |
| 180 | |
| 181 | return ::testing::AssertionSuccess(); |
| 182 | } |
| 183 | |
| 184 | |
| 185 | template <typename T> |