aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/mtproto.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2024-01-22 02:52:58 +0300
committerlevlam <levlam@telegram.org>2024-01-22 02:52:58 +0300
commit1f116cdd99a3a5da5da6ea0663e292c3e3506390 (patch)
treef83d2de31ee73c91cf7539fa37a4cd461d0b89f3 /test/mtproto.cpp
parent0dd1934090ac2d3190628e0bb7984f350cf727d8 (diff)
Reuse the same PublicRsaKeySharedMain object.
Diffstat (limited to 'test/mtproto.cpp')
-rw-r--r--test/mtproto.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/mtproto.cpp b/test/mtproto.cpp
index 342c9b3cc..1ca5fae1f 100644
--- a/test/mtproto.cpp
+++ b/test/mtproto.cpp
@@ -46,6 +46,8 @@
#include "td/utils/tests.h"
#include "td/utils/Time.h"
+#include <memory>
+
TEST(Mtproto, GetHostByNameActor) {
int threads_n = 1;
td::ConcurrentScheduler sched(threads_n, 0);
@@ -300,11 +302,11 @@ class HandshakeContext final : public td::mtproto::AuthKeyHandshakeContext {
return nullptr;
}
td::mtproto::PublicRsaKeyInterface *get_public_rsa_key_interface() final {
- return &public_rsa_key;
+ return public_rsa_key_.get();
}
private:
- td::PublicRsaKeySharedMain public_rsa_key{true};
+ std::shared_ptr<td::mtproto::PublicRsaKeyInterface> public_rsa_key_ = td::PublicRsaKeySharedMain::create(true);
};
class HandshakeTestActor final : public td::Actor {