diff options
| author | levlam <levlam@telegram.org> | 2024-09-10 18:10:08 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-09-10 18:10:08 +0300 |
| commit | ac8c0ee4e7f4016cb9c91decdcaa085277d276fb (patch) | |
| tree | 3809d1019da5cfc699d8153d0471a9725a6d48e6 /test | |
| parent | dcfd86c70c565c9c1d2f576a9ff0a769f2ef5e49 (diff) | |
Improve variable names.
Diffstat (limited to 'test')
| -rw-r--r-- | test/message_entities.cpp | 18 | ||||
| -rw-r--r-- | test/mtproto.cpp | 20 |
2 files changed, 19 insertions, 19 deletions
diff --git a/test/message_entities.cpp b/test/message_entities.cpp index 35150fa06..64cd7dcca 100644 --- a/test/message_entities.cpp +++ b/test/message_entities.cpp @@ -29,7 +29,7 @@ static void check_mention(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -60,7 +60,7 @@ static void check_bot_command(const td::string &str, const td::vector<td::string result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -84,7 +84,7 @@ static void check_hashtag(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -128,7 +128,7 @@ static void check_cashtag(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -190,7 +190,7 @@ static void check_media_timestamp(const td::string &str, const td::vector<std::p auto result = td::transform(td::find_media_timestamps(str), [](auto &&entity) { return std::make_pair(entity.first.str(), entity.second); }); if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -235,7 +235,7 @@ static void check_bank_card_number(const td::string &str, const td::vector<td::s result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -284,7 +284,7 @@ static void check_tg_url(const td::string &str, const td::vector<td::string> &ex result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -464,11 +464,11 @@ static void check_url(const td::string &str, const td::vector<td::string> &expec } } if (result_urls != expected_urls) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result_urls)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result_urls)) << td::tag("expected", td::format::as_array(expected_urls)); } if (result_email_addresses != expected_email_addresses) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result_email_addresses)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result_email_addresses)) << td::tag("expected", td::format::as_array(expected_email_addresses)); } } diff --git a/test/mtproto.cpp b/test/mtproto.cpp index c7bf876e5..72d1af5d7 100644 --- a/test/mtproto.cpp +++ b/test/mtproto.cpp @@ -367,11 +367,11 @@ class HandshakeTestActor final : public td::Actor { 10.0, td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> raw_connection) { - td::send_closure(actor_id, &HandshakeTestActor::got_connection, std::move(raw_connection), 1); + td::send_closure(actor_id, &HandshakeTestActor::on_connection, std::move(raw_connection), 1); }), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> handshake) { - td::send_closure(actor_id, &HandshakeTestActor::got_handshake, std::move(handshake), 1); + td::send_closure(actor_id, &HandshakeTestActor::on_handshake, std::move(handshake), 1); })) .release(); wait_for_raw_connection_ = true; @@ -379,7 +379,7 @@ class HandshakeTestActor final : public td::Actor { } } - void got_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { + void on_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { CHECK(wait_for_raw_connection_); wait_for_raw_connection_ = false; if (r_raw_connection.is_ok()) { @@ -392,7 +392,7 @@ class HandshakeTestActor final : public td::Actor { loop(); } - void got_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { + void on_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { CHECK(wait_for_handshake_); wait_for_handshake_ = false; CHECK(r_handshake.is_ok()); @@ -555,16 +555,16 @@ class FastPingTestActor final : public td::Actor { "HandshakeActor", std::move(handshake), std::move(raw_connection), td::make_unique<HandshakeContext>(), 10.0, td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> raw_connection) { - td::send_closure(actor_id, &FastPingTestActor::got_connection, std::move(raw_connection), 1); + td::send_closure(actor_id, &FastPingTestActor::on_connection, std::move(raw_connection), 1); }), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> handshake) { - td::send_closure(actor_id, &FastPingTestActor::got_handshake, std::move(handshake), 1); + td::send_closure(actor_id, &FastPingTestActor::on_handshake, std::move(handshake), 1); })) .release(); } - void got_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { + void on_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { if (r_raw_connection.is_error()) { *result_ = r_raw_connection.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a connection"; @@ -574,7 +574,7 @@ class FastPingTestActor final : public td::Actor { loop(); } - void got_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { + void on_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { if (r_handshake.is_error()) { *result_ = r_handshake.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a handshake"; @@ -584,7 +584,7 @@ class FastPingTestActor final : public td::Actor { loop(); } - void got_raw_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_connection) { + void on_raw_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_connection) { if (r_connection.is_error()) { *result_ = r_connection.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a handshake"; @@ -621,7 +621,7 @@ class FastPingTestActor final : public td::Actor { td::Slice(), std::move(connection_), std::move(auth_data), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection) { - td::send_closure(actor_id, &FastPingTestActor::got_raw_connection, std::move(r_raw_connection)); + td::send_closure(actor_id, &FastPingTestActor::on_raw_connection, std::move(r_raw_connection)); }), td::ActorShared<>()); } |
