mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Remove auto_delete in favor of std::unique_ptr
This commit is contained in:
parent
e791eb9ca3
commit
05d85e2965
8 changed files with 28 additions and 62 deletions
|
@ -89,7 +89,8 @@ void SocketCoreTest::testInetNtop()
|
|||
addrinfo* res;
|
||||
CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), 0, AF_INET,
|
||||
SOCK_STREAM, 0, 0));
|
||||
WSAAPI_AUTO_DELETE<struct addrinfo*> resDeleter(res, freeaddrinfo);
|
||||
std::unique_ptr<addrinfo, decltype(&freeaddrinfo)> resDeleter
|
||||
(res, freeaddrinfo);
|
||||
sockaddr_in addr;
|
||||
memcpy(&addr, res->ai_addr, sizeof(addr));
|
||||
CPPUNIT_ASSERT_EQUAL(0, inetNtop(AF_INET, &addr.sin_addr,
|
||||
|
@ -101,7 +102,8 @@ void SocketCoreTest::testInetNtop()
|
|||
addrinfo* res;
|
||||
CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), 0, AF_INET6,
|
||||
SOCK_STREAM, 0, 0));
|
||||
WSAAPI_AUTO_DELETE<struct addrinfo*> resDeleter(res, freeaddrinfo);
|
||||
std::unique_ptr<addrinfo, decltype(&freeaddrinfo)> resDeleter
|
||||
(res, freeaddrinfo);
|
||||
sockaddr_in6 addr;
|
||||
memcpy(&addr, res->ai_addr, sizeof(addr));
|
||||
CPPUNIT_ASSERT_EQUAL(0, inetNtop(AF_INET6, &addr.sin6_addr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue