We added 2 macros A2_TEST_DIR and A2_TEST_OUT_DIR to pass tests in
`make distcheck`. A2_TEST_DIR refers to test directory. All output
files by unit tests are now created under A2_TEST_OUT_DIR directory.
Use AI_ADDRCONFIG flag if it is available. Refactored so that
getaddrinfo calls are not scattered around. Unset AI_ADDRCONFIG
when conducting unit tests because they fail if networking
interface is not configured with IPv4 address.
* src/NameResolver.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/a2netcompat.h
* test/AllTest.cc
Added static member _protocolFamily to SocketCore. By default,
SocketCore uses AF_UNSPEC for getaddrinfo hints to resolve
address. Sometime SocketCore::bind() and
SocketCore::establishConnection() use difference protocl family
and latter cannot connect to former. To avoid this situation, we
limit protocol family to AF_INET for unit tests.
* src/SocketCore.cc
* src/SocketCore.h
* test/AllTest.cc
Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this commit,
only the
follow sources are applied.
* src/Platform.h: I removed HAVE_WINSOCK2_H directive from
Platform.h.
* src/Platform.cc: Moved common setup/teardown code to Platform
class.
I moved #endif // HAVE_WINSOCK2_H to the front of #include
"DlAbortEx.h"
I included locale.h from Platform.cc.
* src/main.cc: Moved common setup/teardown code to Platform
class.
* test/AllTest.cc: Use Platform class.
Set locale to C in AllTest.cc to prevent the messages to be
localized.
Rewritten SharedHandle. Now copy constructor taking raw pointer
has
keyword explicit and SharedHandle's default constructor
initializes
its internal obj to null, old implementation initializes it
using
obj's default constructor.
To assign null, write SharedHandle<T> x(...); x.reset();
TODO: test/SharedHandleTest.cc needs more tests.
* src/SharedHandle.h