fix test comparison between -1 and unsigned winsock2.h socket return

This commit is contained in:
James Wu 2021-09-23 22:54:13 -07:00
parent f730e03835
commit 228edc92a9
2 changed files with 23 additions and 0 deletions

15
RELICENSE/analogist.md Normal file
View File

@ -0,0 +1,15 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by James Wu
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "analogist", with
commit author "James Wu <james@analogist.net>", are copyright of James Wu.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
James Wu
2020/09/24

View File

@ -386,7 +386,11 @@ fd_t connect_socket (const char *endpoint_, const int af_, const int protocol_)
protocol_ == IPPROTO_UDP ? IPPROTO_UDP
: protocol_ == IPPROTO_TCP ? IPPROTO_TCP
: 0);
#ifdef ZMQ_HAVE_WINDOWS
TEST_ASSERT_NOT_EQUAL (INVALID_SOCKET, s_pre);
#else
TEST_ASSERT_NOT_EQUAL (-1, s_pre);
#endif
if (af_ == AF_INET || af_ == AF_INET6) {
const char *port = strrchr (endpoint_, ':') + 1;
@ -443,7 +447,11 @@ fd_t bind_socket_resolve_port (const char *address_,
protocol_ == IPPROTO_UDP ? IPPROTO_UDP
: protocol_ == IPPROTO_TCP ? IPPROTO_TCP
: 0);
#ifdef ZMQ_HAVE_WINDOWS
TEST_ASSERT_NOT_EQUAL (INVALID_SOCKET, s_pre);
#else
TEST_ASSERT_NOT_EQUAL (-1, s_pre);
#endif
if (af_ == AF_INET || af_ == AF_INET6) {
#ifdef ZMQ_HAVE_WINDOWS