[glib] Improve coverage of buffered output stream tests
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve coverage of buffered output stream tests
- Date: Fri, 30 Jul 2010 23:59:09 +0000 (UTC)
commit aa196c60df8bbe6f8e998780579b12863098107f
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jul 29 02:20:43 2010 -0400
Improve coverage of buffered output stream tests
gio/tests/buffered-output-stream.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/buffered-output-stream.c b/gio/tests/buffered-output-stream.c
index 9ce4d82..bb6159c 100644
--- a/gio/tests/buffered-output-stream.c
+++ b/gio/tests/buffered-output-stream.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]