mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-25 08:36:52 +02:00
fileutils test: Use no-op invalid-parameter handler when exercising EBADF
This is basically !3036, but wasn't included there because !3036 and !3027 were developed in parallel. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
201c920cbd
commit
1dd11faaea
@ -2485,12 +2485,14 @@ test_clear_fd_ebadf (void)
|
|||||||
int copy_of_fd;
|
int copy_of_fd;
|
||||||
int errsv;
|
int errsv;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
GWin32InvalidParameterHandler handler;
|
||||||
|
|
||||||
/* We're going to trigger a programming error: attmpting to close a
|
/* We're going to trigger a programming error: attmpting to close a
|
||||||
* fd that was already closed. Make criticals non-fatal. */
|
* fd that was already closed. Make criticals non-fatal. */
|
||||||
g_assert_true (g_test_undefined ());
|
g_assert_true (g_test_undefined ());
|
||||||
g_log_set_always_fatal (G_LOG_FATAL_MASK);
|
g_log_set_always_fatal (G_LOG_FATAL_MASK);
|
||||||
g_log_set_fatal_mask ("GLib", G_LOG_FATAL_MASK);
|
g_log_set_fatal_mask ("GLib", G_LOG_FATAL_MASK);
|
||||||
|
GLIB_PRIVATE_CALL (g_win32_push_empty_invalid_parameter_handler) (&handler);
|
||||||
|
|
||||||
fd = g_file_open_tmp (NULL, &name, &error);
|
fd = g_file_open_tmp (NULL, &name, &error);
|
||||||
g_assert_cmpint (fd, !=, -1);
|
g_assert_cmpint (fd, !=, -1);
|
||||||
@ -2532,6 +2534,8 @@ test_clear_fd_ebadf (void)
|
|||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_assert_cmpint (errsv, ==, EILSEQ);
|
g_assert_cmpint (errsv, ==, EILSEQ);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GLIB_PRIVATE_CALL (g_win32_pop_invalid_parameter_handler) (&handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user