* Check whether the given notification type is a Recovery or FlappingEnd notification and the Checkable object * has already recovered. * * For the latter case, if the Checkable has recovered while it was in a Flapping state, the recovery notification * will be silently discarded and leave some internal states of the Notification object that depend on it in an * inconsistent state. So, use th
| 240 | * @return bool |
| 241 | */ |
| 242 | static bool IsRecoveryOrFlappingEndAndCheckableIsOK(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, NotificationType type) |
| 243 | { |
| 244 | if (type == NotificationRecovery) { |
| 245 | return true; |
| 246 | } |
| 247 | |
| 248 | // Check whether missed the Checkable recovery because of its Flapping state. |
| 249 | return type == NotificationFlappingEnd && cr && checkable->IsStateOK(cr->GetState()); |
| 250 | } |
| 251 | |
| 252 | void Notification::BeginExecuteNotification(NotificationType type, const CheckResult::Ptr& cr, bool force, bool reminder, const String& author, const String& text) |
| 253 | { |
no test coverage detected