mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 20:33:08 +02:00
Merge branch 'fileutils-fwrite-retval' into 'main'
tests: Check the return value of fwrite() in a test See merge request GNOME/glib!2946
This commit is contained in:
commit
9fb7edd845
@ -1422,9 +1422,11 @@ test_get_contents (void)
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const gchar *text = "abcdefghijklmnopqrstuvwxyz";
|
const gchar *text = "abcdefghijklmnopqrstuvwxyz";
|
||||||
const gchar *filename = "file-test-get-contents";
|
const gchar *filename = "file-test-get-contents";
|
||||||
|
gsize bytes_written;
|
||||||
|
|
||||||
f = g_fopen (filename, "w");
|
f = g_fopen (filename, "w");
|
||||||
fwrite (text, 1, strlen (text), f);
|
bytes_written = fwrite (text, 1, strlen (text), f);
|
||||||
|
g_assert_cmpint (bytes_written, ==, strlen (text));
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
if (g_test_undefined ())
|
if (g_test_undefined ())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user