mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-20 02:17:55 +00:00
Problem: test_bind_fuzzer does not build on OSX
Solution: use POSIX API instead of GNU extension
This commit is contained in:
parent
1d2af8d388
commit
3856027da9
@ -36,13 +36,18 @@
|
|||||||
#include "testutil.hpp"
|
#include "testutil.hpp"
|
||||||
#include "testutil_unity.hpp"
|
#include "testutil_unity.hpp"
|
||||||
|
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX 1024
|
||||||
|
#endif
|
||||||
|
|
||||||
// Test that zmq_bind can handle malformed strings
|
// Test that zmq_bind can handle malformed strings
|
||||||
extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
||||||
{
|
{
|
||||||
// This test might create socket files, so move to /tmp to avoid clobbering
|
// This test might create socket files, so move to /tmp to avoid clobbering
|
||||||
// the working directory with random filenames
|
// 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 (pwd);
|
||||||
|
TEST_ASSERT_NOT_NULL (getcwd (pwd, PATH_MAX + 1));
|
||||||
TEST_ASSERT_SUCCESS_ERRNO (chdir ("/tmp"));
|
TEST_ASSERT_SUCCESS_ERRNO (chdir ("/tmp"));
|
||||||
|
|
||||||
setup_test_context ();
|
setup_test_context ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user