summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/libuv/test/test-tcp-create-socket-early.c
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/libuv/test/test-tcp-create-socket-early.c')
-rw-r--r--3rdparty/libuv/test/test-tcp-create-socket-early.c206
1 files changed, 0 insertions, 206 deletions
diff --git a/3rdparty/libuv/test/test-tcp-create-socket-early.c b/3rdparty/libuv/test/test-tcp-create-socket-early.c
deleted file mode 100644
index 65650adcc27..00000000000
--- a/3rdparty/libuv/test/test-tcp-create-socket-early.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Copyright (c) 2015 Saúl Ibarra Corretgé <saghul@gmail.com>.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "uv.h"
-#include "task.h"
-#include <string.h>
-
-#ifdef _WIN32
-# define INVALID_FD (INVALID_HANDLE_VALUE)
-#else
-# define INVALID_FD (-1)
-#endif
-
-
-static void on_connect(uv_connect_t* req, int status) {
- ASSERT(status == 0);
- uv_close((uv_handle_t*) req->handle, NULL);
-}
-
-
-static void on_connection(uv_stream_t* server, int status) {
- uv_tcp_t* handle;
- int r;
-
- ASSERT(status == 0);
-
- handle = malloc(sizeof(*handle));
- ASSERT(handle != NULL);
-
- r = uv_tcp_init_ex(server->loop, handle, AF_INET);
- ASSERT(r == 0);
-
- r = uv_accept(server, (uv_stream_t*)handle);
- ASSERT(r == UV_EBUSY);
-
- uv_close((uv_handle_t*) server, NULL);
- uv_close((uv_handle_t*) handle, (uv_close_cb)free);
-}
-
-
-static void tcp_listener(uv_loop_t* loop, uv_tcp_t* server) {
- struct sockaddr_in addr;
- int r;
-
- ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr));
-
- r = uv_tcp_init(loop, server);
- ASSERT(r == 0);
-
- r = uv_tcp_bind(server, (const struct sockaddr*) &addr, 0);
- ASSERT(r == 0);
-
- r = uv_listen((uv_stream_t*) server, 128, on_connection);
- ASSERT(r == 0);
-}
-
-
-static void tcp_connector(uv_loop_t* loop, uv_tcp_t* client, uv_connect_t* req) {
- struct sockaddr_in server_addr;
- int r;
-
- ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr));
-
- r = uv_tcp_init(loop, client);
- ASSERT(r == 0);
-
- r = uv_tcp_connect(req,
- client,
- (const struct sockaddr*) &server_addr,
- on_connect);
- ASSERT(r == 0);
-}
-
-
-TEST_IMPL(tcp_create_early) {
- struct sockaddr_in addr;
- struct sockaddr_in sockname;
- uv_tcp_t client;
- uv_os_fd_t fd;
- int r, namelen;
-
- ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
-
- r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET);
- ASSERT(r == 0);
-
- r = uv_fileno((const uv_handle_t*) &client, &fd);
- ASSERT(r == 0);
- ASSERT(fd != INVALID_FD);
-
- /* Windows returns WSAEINVAL if the socket is not bound */
-#ifndef _WIN32
- namelen = sizeof sockname;
- r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen);
- ASSERT(r == 0);
- ASSERT(sockname.sin_family == AF_INET);
-#endif
-
- r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0);
- ASSERT(r == 0);
-
- namelen = sizeof sockname;
- r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen);
- ASSERT(r == 0);
- ASSERT(memcmp(&addr.sin_addr,
- &sockname.sin_addr,
- sizeof(addr.sin_addr)) == 0);
-
- uv_close((uv_handle_t*) &client, NULL);
- uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
-
-
-TEST_IMPL(tcp_create_early_bad_bind) {
- struct sockaddr_in addr;
- uv_tcp_t client;
- uv_os_fd_t fd;
- int r;
-
- ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
-
- r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET6);
- ASSERT(r == 0);
-
- r = uv_fileno((const uv_handle_t*) &client, &fd);
- ASSERT(r == 0);
- ASSERT(fd != INVALID_FD);
-
- /* Windows returns WSAEINVAL if the socket is not bound */
-#ifndef _WIN32
- {
- int namelen;
- struct sockaddr_in6 sockname;
- namelen = sizeof sockname;
- r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen);
- ASSERT(r == 0);
- ASSERT(sockname.sin6_family == AF_INET6);
- }
-#endif
-
- r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0);
-#ifndef _WIN32
- ASSERT(r == UV_EINVAL);
-#else
- ASSERT(r == UV_EFAULT);
-#endif
-
- uv_close((uv_handle_t*) &client, NULL);
- uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
-
-
-TEST_IMPL(tcp_create_early_bad_domain) {
- uv_tcp_t client;
- int r;
-
- r = uv_tcp_init_ex(uv_default_loop(), &client, 47);
- ASSERT(r == UV_EINVAL);
-
- r = uv_tcp_init_ex(uv_default_loop(), &client, 1024);
- ASSERT(r == UV_EINVAL);
-
- uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
-
-
-TEST_IMPL(tcp_create_early_accept) {
- uv_tcp_t client, server;
- uv_connect_t connect_req;
-
- tcp_listener(uv_default_loop(), &server);
- tcp_connector(uv_default_loop(), &client, &connect_req);
-
- uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-
- MAKE_VALGRIND_HAPPY();
- return 0;
-}
3&d=retro' /> mooglyguy5 years saturn_cdblockAttempting to change transfer active mechanism, doesn't change anything, to b... angelosa10 years saturn_vdp_splitsegasaturn_vdp2.cpp: add m_gfxdecode device, fix startup crash. Add notes rev... angelosa3 years save-experimentsBetter handling of null/missing items. More consistent error handling. Reduce... Aaron Giles4 years save_structsUpdate voodoo code to leverage new save_registrar instead of its own temporar... Aaron Giles4 years shangha3_dropshangha3_v.cpp: proposed fix for shangha3 drawing phantom drop shadows for pl... angelosa3 years taitoair_vcotaito/tc0080vco.cpp: describe fix angelosa2 years taitowlf_zoomtaito/taitowlf.cpp: preliminary Zoom hookup angelosa23 months time-experimentsRemaining fixes Aaron Giles4 years time-experiments2Stop memsetting structures. Aaron Giles4 years vamphalf_misncrftvamphalf.cpp: move wyvernwg to own state machine, add some basic protection t... angelosa3 years voodoo_directx11Fix some vegas games not booting Ted Green5 years x86_std-exceptionscpu/i386: saner fatal error handling angelosa13 months xbox_swlisthash/xbox_hdd.xml: QA and srcclean angelosa10 months xtalfull xtal conversion Olivier Galibert4 days ymfm-delayClean up delay implementation a bit. Move delay setting to immediately after ... Aaron Giles4 years  TagDownloadAuthorAge mame0277commit 84cb44566c... Vas Crabb5 days mame0276commit 758c8a169a... Vas Crabb5 weeks mame0275commit 455ffbbd7e... Vas Crabb2 months mame0274commit cd82a83c3d... Vas Crabb3 months mame0273commit e11cae0a15... Vas Crabb4 months mame0272commit 5d8e4cf07e... Vas Crabb5 months mame0271commit 4da96a0c4f... Vas Crabb6 months mame0270commit ef032a31e5... Vas Crabb7 months mame0269commit 6d1970f5f1... Vas Crabb8 months mame0268commit acea8712d6... Vas Crabb9 months mame0267commit 663abae071... Vas Crabb10 months mame0266commit cd7817b220... Vas Crabb11 months mame0265commit f8af5cc2cf... Vas Crabb12 months mame0264commit 5b670ad51f... Vas Crabb13 months mame0263commit 93d8318325... Vas Crabb14 months mame0262commit d48a61f921... Vas Crabb15 months mame0261commit ca50094e8d... Vas Crabb17 months mame0260commit 0a7f1fe9cf... Vas Crabb18 months mame0259commit 4ff20056c3... Vas Crabb19 months mame0258commit 2e0aa82350... Vas Crabb20 months mame0257commit f811a66c53... Vas Crabb21 months mame0256commit b41370db02... Vas Crabb22 months mame0255commit c6650dc072... Vas Crabb23 months mame0254commit bfa8d724a0... Vas Crabb2 years mame0253commit b6d9756c5e... Vas Crabb2 years mame0252commit fb98822c34... Vas Crabb2 years mame0251commit 34e6ec1ef8... Vas Crabb2 years mame0250commit b7cbe74c4b... Vas Crabb2 years mame0249commit 91c5b9ecea... Vas Crabb3 years mame0248commit 2d3d0deec8... Vas Crabb3 years mame0247commit fa2d36c634... Vas Crabb3 years mame0246commit 205b03897c... Vas Crabb3 years mame0245commit 5d31f0fc97... Vas Crabb3 years mame0244commit bcf77373a5... Vas Crabb3 years mame0243commit addbb8ab40... Vas Crabb3 years mame0242commit e8166b5274...