Philip Withnall
05e529f3f8
tests: Add tests for g_socket_listener_add_any_inet_port() algorithm
...
The algorithm that `g_socket_listener_add_any_inet_port()` and
`g_socket_listener_add_inet_port()` use to try to connect to IPv4 and/or
IPv6 ports are a bit complex (especially when port allocation has to
happen in the former method). So far they’ve not really been unit
tested, which is unfortunate, and has left latent bugs.
Add some unit tests for both methods, by providing mock `socket()` (and
friends) functions to override those from libc, and using those to cause
specific syscalls to fail according to the test’s needs.
These tests demonstrate the fix for #1250 works, as the tests can be run
under memcheck and show no memory leaks. They’ve revealed a follow-up
issue, though — `g_socket_listener_add_any_inet_port()` doesn’t try a
fallback IPv4-only socket if it tries an IPv6 socket and that socket
accepts IPv4 but then fails to `listen()`. I’ve filed issue #3604 for
that.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #1250
2025-03-13 13:25:06 +00:00
..
2022-01-07 11:27:56 -06:00
2023-05-10 10:56:44 +07:00
2024-03-13 03:32:56 +05:30
2022-10-13 20:53:56 -04:00
2024-10-01 15:22:40 +01:00
2020-11-15 17:34:27 +01:00
2024-05-15 14:00:09 +01:00
2022-09-13 02:44:25 +02:00
2022-12-12 15:58:13 +01:00
2020-06-10 09:48:02 +01:00
2024-06-14 16:35:44 +01:00
2023-11-27 14:15:36 +00:00
2024-11-13 14:24:50 +01:00
2023-10-03 09:10:21 +01:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2023-05-22 22:44:52 +02:00
2022-11-02 12:34:19 +00:00
2025-02-04 14:06:15 +00:00
2024-02-06 14:06:45 +00:00
2024-11-08 22:34:38 +00:00
2022-12-13 14:07:58 +00:00
2022-11-02 12:34:19 +00:00
2024-11-16 07:46:24 +00:00
2022-11-02 12:34:19 +00:00
2023-10-12 11:45:03 +02:00
2024-10-17 11:42:49 +01:00
2024-04-25 00:37:47 +01:00
2024-12-10 11:47:43 +00:00
2022-05-18 09:20:07 +01:00
2023-08-03 09:16:26 -05:00
2024-10-08 13:57:30 +01:00
2024-01-23 21:35:54 -08:00
2024-06-14 16:35:44 +01:00
2021-05-13 20:16:46 +00:00
2020-11-14 19:03:18 +00:00
2024-06-13 20:00:12 +01:00
2024-12-10 11:47:43 +00:00
2024-12-10 11:47:43 +00:00
2024-10-01 15:22:40 +01:00
2024-10-01 15:22:40 +01:00
2023-01-17 21:08:49 +01:00
2022-12-09 10:45:21 +00:00
2022-12-08 05:21:19 +01:00
2024-10-14 18:29:29 -07:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-11-02 12:34:19 +00:00
2023-10-03 09:32:44 +01:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2021-05-13 20:16:46 +00:00
2021-05-13 20:16:46 +00:00
2024-02-09 10:04:14 +00:00
2023-05-22 22:44:52 +02:00
2024-09-26 12:48:16 +01:00
2022-06-23 10:47:13 +01:00
2022-11-23 11:15:20 +00:00
2023-03-13 11:21:17 +00:00
2022-11-23 11:15:20 +00:00
2023-08-16 14:31:40 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-11-23 11:15:20 +00:00
2024-10-08 13:57:30 +01:00
2024-10-08 13:57:30 +01:00
2021-05-13 20:16:46 +00:00
2024-05-16 22:52:23 +01:00
2024-05-16 22:52:23 +01:00
2020-10-01 16:32:50 +01:00
2021-05-13 20:16:46 +00:00
2023-01-31 11:44:44 +00:00
2023-03-20 13:03:04 +00:00
2024-05-16 22:52:23 +01:00
2021-04-23 10:43:05 +02:00
2021-05-13 20:16:46 +00:00
2021-05-13 20:16:46 +00:00
2024-05-16 22:52:22 +01:00
2024-12-10 15:53:54 +00:00
2024-05-16 22:52:23 +01:00
2022-11-23 11:15:20 +00:00
2024-05-16 22:52:23 +01:00
2024-05-16 22:52:22 +01:00
2022-06-23 10:47:13 +01:00
2022-11-23 11:15:20 +00:00
2024-09-26 12:48:16 +01:00
2024-05-16 22:52:23 +01:00
2024-05-16 22:52:23 +01:00
2022-11-23 11:15:20 +00:00
2022-11-23 11:15:20 +00:00
2024-05-16 22:52:22 +01:00
2022-07-18 19:39:41 +01:00
2024-09-26 12:48:16 +01:00
2022-11-10 14:25:47 +00:00
2024-09-27 17:08:21 +01:00
2024-09-27 17:08:21 +01:00
2024-10-08 13:57:30 +01:00
2024-05-16 22:52:23 +01:00
2022-11-23 11:15:20 +00:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2024-09-26 12:48:16 +01:00
2024-10-08 13:57:30 +01:00
2020-11-17 15:50:07 +00:00
2022-06-28 11:19:21 +01:00
2024-03-27 12:07:42 +00:00
2023-11-08 10:29:43 +00:00
2022-11-07 11:30:32 +00:00
2023-01-06 11:46:01 +00:00
2024-07-24 00:21:35 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2024-06-14 23:05:25 +01:00
2022-06-23 10:47:13 +01:00
2024-12-08 22:15:03 +01:00
2024-07-09 17:40:16 +01:00
2023-11-01 17:56:48 +00:00
2024-05-09 17:51:10 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2023-05-22 22:44:52 +02:00
2022-06-01 12:44:23 +01:00
2021-05-13 20:16:46 +00:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2023-02-16 13:50:15 +00:00
2020-06-12 15:01:08 +01:00
2022-10-27 14:50:48 +01:00
2022-11-02 12:34:19 +00:00
2024-01-23 11:02:48 +00:00
2024-01-30 07:38:13 +00:00
2022-05-18 09:20:07 +01:00
2024-06-26 14:18:41 -04:00
2022-07-15 22:07:03 +02:00
2024-11-09 13:42:47 +01:00
2021-04-15 10:19:29 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2023-08-14 09:32:43 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2022-07-15 22:07:03 +02:00
2021-06-04 12:09:24 +00:00
2024-10-01 18:25:52 +02:00
2023-08-03 09:16:26 -05:00
2024-09-27 21:45:33 +02:00
2022-11-02 12:34:19 +00:00
2023-01-27 11:58:56 +03:00
2023-10-02 15:00:23 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2024-01-23 11:02:48 +00:00
2024-01-23 11:02:48 +00:00
2022-05-18 09:20:07 +01:00
2023-12-20 16:14:57 +00:00
2022-05-18 09:20:07 +01:00
2021-04-29 12:40:05 +02:00
2024-07-09 21:41:03 +01:00
2023-04-27 12:23:25 +01:00
2022-10-13 20:53:56 -04:00
2024-09-17 13:34:06 +00:00
2022-11-24 20:03:39 +01:00
2021-05-13 20:16:46 +00:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2023-04-29 21:48:03 +03:00
2025-03-13 13:25:06 +00:00
2022-05-18 09:20:07 +01:00
2023-04-29 21:48:03 +03:00
2023-04-29 21:48:03 +03:00
2024-09-17 23:54:55 +01:00
2024-06-28 14:25:38 +01:00
2022-06-01 12:44:23 +01:00
2023-11-02 17:49:31 +00:00
2020-11-17 15:50:07 +00:00
2024-04-25 00:37:47 +01:00
2020-06-12 15:01:08 +01:00
2024-09-09 17:37:52 +01:00
2023-06-30 22:59:37 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2020-11-14 19:03:18 +00:00
2024-09-19 09:55:01 +03:00
2022-11-02 12:34:19 +00:00
2022-06-23 10:47:13 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2023-12-20 16:14:57 +00:00
2024-10-22 15:31:52 +01:00
2023-08-16 14:31:40 +01:00
2024-10-22 16:15:18 +01:00
2022-11-02 12:34:19 +00:00
2023-08-29 11:22:43 +01:00
2020-06-10 09:48:02 +01:00
2022-11-02 12:34:19 +00:00
2023-10-12 11:32:03 +02:00