fix(SocketProactor): test

This commit is contained in:
Alex Fabijanic 2021-09-03 15:10:09 +02:00
parent fef9d34e29
commit da70f91796

View File

@ -215,7 +215,8 @@ void SocketProactorTest::testSocketProactorStartStop()
proactor.stop(); proactor.stop();
}; };
proactor.addReceiveFrom(s, buf, sa, onRecvCompletion); proactor.addReceiveFrom(s, buf, sa, onRecvCompletion);
proactor.run();
while (!received) proactor.poll();
assertTrue (sent); assertTrue (sent);
assertTrue (sendPassed); assertTrue (sendPassed);
@ -241,7 +242,7 @@ void SocketProactorTest::testSocketProactorStartStop()
SocketAddress("127.0.0.1", echoServer.port()), SocketAddress("127.0.0.1", echoServer.port()),
onSendCompletion); onSendCompletion);
proactor.addReceiveFrom(s, buf, sa, onRecvCompletion); proactor.addReceiveFrom(s, buf, sa, onRecvCompletion);
proactor.run(); while (!received) proactor.poll();
assertTrue(std::string(buf.begin(), buf.end()) == hello); assertTrue(std::string(buf.begin(), buf.end()) == hello);
assertTrue (sent); assertTrue (sent);