diff --git a/test/tdclient.cpp b/test/tdclient.cpp index 76cab5a8..9a841b71 100644 --- a/test/tdclient.cpp +++ b/test/tdclient.cpp @@ -869,4 +869,26 @@ TEST(Client, SimpleMulti) { } } +TEST(Client, Multi) { + std::vector threads; + for (int i = 0; i < 4; i++) { + threads.emplace_back([] { + for (int i = 0; i < 1000; i++) { + td::Client client; + client.send({3, td::make_tl_object(3)}); + while (true) { + auto result = client.receive(10); + if (result.id == 3) { + break; + } + } + } + }); + } + + for (auto &thread : threads) { + thread.join(); + } +} + } // namespace td