diff options
| author | levlam <levlam@telegram.org> | 2021-10-21 12:51:16 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2021-10-21 12:51:16 +0300 |
| commit | 9f44816a6211fdefc8261d7b8a3f670575ca6df7 (patch) | |
| tree | ce060fb9d5bd3605245cb2cbe151721245e8db4a /test/secret.cpp | |
| parent | 1ebf835ac56aebb2631d30cecd58fa4fcf7c970d (diff) | |
Minor improvements.
Diffstat (limited to 'test/secret.cpp')
| -rw-r--r-- | test/secret.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/secret.cpp b/test/secret.cpp index 3bffb0f88..5dd40afb3 100644 --- a/test/secret.cpp +++ b/test/secret.cpp @@ -764,15 +764,17 @@ class Master final : public Actor { bob_ = create_actor<SecretChatProxy>("SecretChatProxy bob", "bob", actor_shared(this, 2)); send_closure(alice_->get_actor_unsafe()->actor_, &SecretChatActor::create_chat, UserId(static_cast<int64>(2)), 0, 123, PromiseCreator::lambda([actor_id = actor_id(this)](Result<SecretChatId> res) { - send_closure(actor_id, &Master::got_secret_chat_id, std::move(res), 0); + send_closure(actor_id, &Master::got_secret_chat_id, std::move(res), false); })); } - void got_secret_chat_id(Result<SecretChatId> res, int) { // second parameter is needed to workaround clang bug + + void got_secret_chat_id(Result<SecretChatId> res, bool dummy) { CHECK(res.is_ok()); auto id = res.move_as_ok(); LOG(INFO) << "SecretChatId = " << id; } - bool can_fail(NetQueryPtr &query) { + + static bool can_fail(NetQueryPtr &query) { static int cnt = 20; if (cnt > 0) { cnt--; @@ -784,6 +786,7 @@ class Master final : public Actor { } return false; } + void send_net_query(NetQueryPtr query, ActorShared<NetQueryCallback> callback, bool ordered) { if (can_fail(query) && Random::fast_bool()) { LOG(INFO) << "Fail query " << query; |
