Improve CHECK messages.

This commit is contained in:
levlam 2021-04-07 23:43:24 +03:00
parent ad17a75f28
commit 5a7015b9fe

View File

@ -34337,11 +34337,13 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr<Message> &&last_datab
<< ", max_notification_message_id = " << d->max_notification_message_id; << ", max_notification_message_id = " << d->max_notification_message_id;
if (d->messages != nullptr) { if (d->messages != nullptr) {
CHECK(d->messages->message_id == last_message_id); auto get_debug_source = [](const unique_ptr<Message> &message) {
LOG_CHECK(d->messages->left == nullptr) return message->debug_source != nullptr ? message->debug_source : "null";
<< (d->messages->left->debug_source != nullptr ? d->messages->left->debug_source : "null"); };
LOG_CHECK(d->messages->right == nullptr) LOG_CHECK(d->messages->message_id == last_message_id)
<< (d->messages->right->debug_source != nullptr ? d->messages->right->debug_source : "null"); << d->messages->message_id << ' ' << last_message_id << ' ' << get_debug_source(d->messages);
LOG_CHECK(d->messages->left == nullptr) << get_debug_source(d->messages->left);
LOG_CHECK(d->messages->right == nullptr) << get_debug_source(d->messages->right);
} }
} }