Skip to content

Commit

Permalink
workaround for a bug of msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 28, 2019
1 parent 331f958 commit 6db0aa7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/uvw/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TEST(TCP, ReadWrite) {

TEST(TCP, SockPeer) {
const std::string address = std::string{"127.0.0.1"};
constexpr unsigned int port = 4242;
const unsigned int port = 4242;

auto loop = uvw::Loop::getDefault();
auto server = loop->resource<uvw::TCPHandle>();
Expand All @@ -70,7 +70,7 @@ TEST(TCP, SockPeer) {
server->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
client->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });

server->once<uvw::ListenEvent>([&address](const uvw::ListenEvent &, uvw::TCPHandle &handle) {
server->once<uvw::ListenEvent>([&](const uvw::ListenEvent &, uvw::TCPHandle &handle) {
std::shared_ptr<uvw::TCPHandle> socket = handle.loop().resource<uvw::TCPHandle>();

socket->on<uvw::ErrorEvent>([](const uvw::ErrorEvent &, uvw::TCPHandle &) { FAIL(); });
Expand All @@ -86,7 +86,7 @@ TEST(TCP, SockPeer) {
ASSERT_EQ(addr.port, decltype(addr.port){port});
});

client->once<uvw::ConnectEvent>([&address](const uvw::ConnectEvent &, uvw::TCPHandle &handle) {
client->once<uvw::ConnectEvent>([&](const uvw::ConnectEvent &, uvw::TCPHandle &handle) {
uvw::Addr addr = handle.peer();

ASSERT_EQ(addr.ip, address);
Expand Down

0 comments on commit 6db0aa7

Please sign in to comment.