[glib] gio/tests/socket.c: clean up a test case a bit
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gio/tests/socket.c: clean up a test case a bit
- Date: Mon, 29 Jun 2015 18:41:25 +0000 (UTC)
commit b97d666b2f4ce7f05b54f07906122608358fc177
Author: Dan Winship <danw gnome org>
Date: Sun Jun 21 12:00:07 2015 -0400
gio/tests/socket.c: clean up a test case a bit
gio/tests/socket.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/gio/tests/socket.c b/gio/tests/socket.c
index a1f48bc..cb2cda2 100644
--- a/gio/tests/socket.c
+++ b/gio/tests/socket.c
@@ -930,30 +930,30 @@ test_timed_wait (void)
}
static int
-duplicate_fd(int fd)
+duplicate_fd (int fd)
{
#ifdef G_OS_WIN32
- HANDLE newfd;
-
- if (!DuplicateHandle (GetCurrentProcess (),
- (HANDLE)fd,
- GetCurrentProcess (),
- &newfd,
- 0,
- FALSE,
- DUPLICATE_SAME_ACCESS))
+ HANDLE newfd;
+
+ if (!DuplicateHandle (GetCurrentProcess (),
+ (HANDLE)fd,
+ GetCurrentProcess (),
+ &newfd,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS))
{
- return -1;
+ return -1;
}
- return (int)newfd;
+ return (int)newfd;
#else
- return dup(fd);
+ return dup (fd);
#endif
}
static void
-test_fd_roundtrip (void)
+test_fd_reuse (void)
{
IPTestData *data;
GError *error = NULL;
@@ -964,6 +964,8 @@ test_fd_roundtrip (void)
gssize len;
gchar buf[128];
+ g_test_bug ("741707");
+
data = create_server (G_SOCKET_FAMILY_IPV4, echo_server_thread, FALSE);
addr = g_socket_get_local_address (data->server, &error);
g_assert_no_error (error);
@@ -1421,6 +1423,7 @@ main (int argc,
GError *error = NULL;
g_test_init (&argc, &argv, NULL);
+ g_test_bug_base ("https://bugzilla.gnome.org/";);
sock = g_socket_new (G_SOCKET_FAMILY_IPV6,
G_SOCKET_TYPE_STREAM,
@@ -1448,7 +1451,7 @@ main (int argc,
#endif
g_test_add_func ("/socket/close_graceful", test_close_graceful);
g_test_add_func ("/socket/timed_wait", test_timed_wait);
- g_test_add_func ("/socket/fd_roundtrip", test_fd_roundtrip);
+ g_test_add_func ("/socket/fd_reuse", test_fd_reuse);
g_test_add_func ("/socket/address", test_sockaddr);
#ifdef G_OS_UNIX
g_test_add_func ("/socket/unix-from-fd", test_unix_from_fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]