mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-01 16:56:18 +01:00
Improve coverage of buffered output stream tests
This commit is contained in:
parent
ffa938fc65
commit
aa196c60df
@ -43,13 +43,18 @@ test_grow (void)
|
||||
GOutputStream *out;
|
||||
GError *error;
|
||||
const gchar buffer[] = "abcdefghijklmnopqrstuvwxyz";
|
||||
gint size;
|
||||
gboolean grow;
|
||||
|
||||
base = g_memory_output_stream_new (g_malloc0 (30), 30, g_realloc, g_free);
|
||||
out = g_buffered_output_stream_new (base);
|
||||
out = g_buffered_output_stream_new_sized (base, 16);
|
||||
|
||||
g_buffered_output_stream_set_buffer_size (G_BUFFERED_OUTPUT_STREAM (out), 16);
|
||||
g_buffered_output_stream_set_auto_grow (G_BUFFERED_OUTPUT_STREAM (out), TRUE);
|
||||
|
||||
g_object_get (out, "buffer-size", &size, "auto-grow", &grow, NULL);
|
||||
g_assert_cmpint (size, ==, 16);
|
||||
g_assert (grow);
|
||||
|
||||
error = NULL;
|
||||
g_assert_cmpint (g_output_stream_write (out, buffer, 10, NULL, &error), ==, 10);
|
||||
g_assert_no_error (error);
|
||||
|
Loading…
Reference in New Issue
Block a user