| 348 | bool ErrorMonitor::NeedCheckSuccess() const { return ExpectingSuccess(); } |
| 349 | |
| 350 | void ErrorMonitor::VerifyFound() { |
| 351 | { |
| 352 | // The lock must be released before the ExpectSuccess call at the end |
| 353 | auto guard = Lock(); |
| 354 | // Not receiving expected message(s) is a failure. |
| 355 | for (const auto& desired_msg : desired_messages_) { |
| 356 | ADD_FAILURE() << "Did not receive expected error '" << desired_msg.Print() << "'"; |
| 357 | } |
| 358 | |
| 359 | MonitorReset(); |
| 360 | } |
| 361 | |
| 362 | ExpectSuccess(); |
| 363 | } |
| 364 | |
| 365 | void ErrorMonitor::Finish() { |
| 366 | VerifyNotFound(); |