mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-12 17:12:46 +00:00
Merge pull request #3958 from bluca/fix_tests
Problems: formatting error in ip.cpp and test_bind_fuzzer doesn't build on OSX
This commit is contained in:
commit
b4aa912467
@ -102,9 +102,8 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_)
|
||||
#if defined ZMQ_HAVE_WINDOWS && defined WSA_FLAG_NO_HANDLE_INHERIT
|
||||
// if supported, create socket with WSA_FLAG_NO_HANDLE_INHERIT, such that
|
||||
// the race condition in making it non-inheritable later is avoided
|
||||
const fd_t s =
|
||||
WSASocket (domain_, type_, protocol_, NULL, 0,
|
||||
WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
|
||||
const fd_t s = WSASocket (domain_, type_, protocol_, NULL, 0,
|
||||
WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
|
||||
#else
|
||||
const fd_t s = socket (domain_, type_, protocol_);
|
||||
#endif
|
||||
|
@ -36,13 +36,18 @@
|
||||
#include "testutil.hpp"
|
||||
#include "testutil_unity.hpp"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
// Test that zmq_bind can handle malformed strings
|
||||
extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
||||
{
|
||||
// This test might create socket files, so move to /tmp to avoid clobbering
|
||||
// the working directory with random filenames
|
||||
char *pwd = get_current_dir_name ();
|
||||
char *pwd = (char *) malloc (PATH_MAX + 1);
|
||||
TEST_ASSERT_NOT_NULL (pwd);
|
||||
TEST_ASSERT_NOT_NULL (getcwd (pwd, PATH_MAX + 1));
|
||||
TEST_ASSERT_SUCCESS_ERRNO (chdir ("/tmp"));
|
||||
|
||||
setup_test_context ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user