1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

add benchmark

This commit is contained in:
Desour 2024-03-02 21:58:18 +01:00
parent d96894e606
commit 22b4f3becf
4 changed files with 103 additions and 3 deletions

View file

@ -276,6 +276,7 @@ void TestThreading::testIPCChannel()
IPCChannelEnd end_a = IPCChannelEnd::makeA(std::move(resources_first));
// echos back messages. stops if "" is sent
std::thread thread_b([=] {
auto resources_second = std::make_unique<IPCChannelResourcesSingleProcess>();
resources_second->setSecond(resource_data);
@ -297,6 +298,7 @@ void TestThreading::testIPCChannel()
UASSERTEQ(int, ((const char *)end_a.getRecvData())[i - 1], 123);
}
// stop thread_b
UASSERT(end_a.exchangeWithTimeout(buf, 0, -1));
UASSERTEQ(int, end_a.getRecvSize(), 0);