mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 04:19:10 -04:00
Remove the now-obsolete setup_test() and cleanup_test() functions
This commit is contained in:
parent
899b0a39ab
commit
e73f1d792a
@ -297,54 +297,14 @@ combined_write_cb(evutil_socket_t fd, short event, void *arg)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test infrastructure */
|
/* These macros used to replicate the work of the legacy test wrapper code */
|
||||||
|
#define setup_test(x) do { \
|
||||||
static int
|
if (!in_legacy_test_wrapper) { \
|
||||||
setup_test(const char *name)
|
TT_FAIL(("Legacy test %s not wrapped properly", x)); \
|
||||||
{
|
return; \
|
||||||
if (in_legacy_test_wrapper)
|
} \
|
||||||
return 0;
|
} while (0)
|
||||||
|
#define cleanup_test() setup_test("cleanup")
|
||||||
fprintf(stdout, "%s", name);
|
|
||||||
|
|
||||||
if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
|
|
||||||
fprintf(stderr, "%s: socketpair\n", __func__);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (evutil_make_socket_nonblocking(pair[0]) == -1)
|
|
||||||
fprintf(stderr, "fcntl(O_NONBLOCK)");
|
|
||||||
|
|
||||||
if (evutil_make_socket_nonblocking(pair[1]) == -1)
|
|
||||||
fprintf(stderr, "fcntl(O_NONBLOCK)");
|
|
||||||
|
|
||||||
test_ok = 0;
|
|
||||||
called = 0;
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
cleanup_test(void)
|
|
||||||
{
|
|
||||||
if (in_legacy_test_wrapper)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
close(pair[0]);
|
|
||||||
close(pair[1]);
|
|
||||||
#else
|
|
||||||
CloseHandle((HANDLE)pair[0]);
|
|
||||||
CloseHandle((HANDLE)pair[1]);
|
|
||||||
#endif
|
|
||||||
if (test_ok)
|
|
||||||
fprintf(stdout, "OK\n");
|
|
||||||
else {
|
|
||||||
fprintf(stdout, "FAILED\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
test_ok = 0;
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_simpleread(void)
|
test_simpleread(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user