mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gio: Update GMemoryOutputStream length after truncate
For GMemoryOutputStream, update valid_len when truncating so that g_memory_output_stream_get_data_size () returns the correct result. https://bugzilla.gnome.org/show_bug.cgi?id=720080
This commit is contained in:
committed by
Matthias Clasen
parent
c34cc2348c
commit
3b9ad6e6ef
@@ -50,6 +50,11 @@ test_truncate (void)
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
g_test_bug ("720080");
|
||||
|
||||
g_seekable_truncate (G_SEEKABLE (mo), 8192, NULL, &error);
|
||||
g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mo)), ==, 8192);
|
||||
|
||||
g_object_unref (o);
|
||||
g_object_unref (mo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user