Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as

2009-02-26  Alexander Larsson  <alexl@redhat.com>

	Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as document
        * gmemoryoutputstream.c:
	Track actual valid size, even if we later seek back.

        * tests/memory-output-stream.c:
	Add testcase



svn path=/trunk/; revision=7916
This commit is contained in:
Alexander Larsson
2009-02-26 15:41:29 +00:00
committed by Alexander Larsson
parent 1ab68f9ee9
commit b89e432e8d
3 changed files with 27 additions and 1 deletions

View File

@@ -72,6 +72,15 @@ test_data_size (void)
pos = g_seekable_tell (G_SEEKABLE (mo));
g_assert_cmpint (pos, ==, 1);
g_test_bug ("540461");
g_seekable_seek (G_SEEKABLE (mo), 0, G_SEEK_SET, NULL, NULL);
pos = g_seekable_tell (G_SEEKABLE (mo));
g_assert_cmpint (pos, ==, 0);
pos = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mo));
g_assert_cmpint (pos, ==, 1);
g_object_unref (o);
g_object_unref (mo);
}