From: Matthias Clasen Date: Sun, 2 Jun 2013 05:41:50 +0000 (-0400) Subject: Improve test coverage for GZipCompressor X-Git-Tag: 2.37.2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49d39633d15427436a18e160f06aab12dce6f378;p=platform%2Fupstream%2Fglib.git Improve test coverage for GZipCompressor --- diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c index 7c58f03..f2d45db 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -747,6 +747,8 @@ test_roundtrip (gconstpointer data) GConverter *compressor, *decompressor; GZlibCompressorFormat fmt; gint lvl; + GFileInfo *info; + GFileInfo *info2; g_test_bug ("619945"); @@ -759,6 +761,12 @@ test_roundtrip (gconstpointer data) ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); compressor = G_CONVERTER (g_zlib_compressor_new (test->format, test->level)); + info = g_file_info_new (); + g_file_info_set_name (info, "foo"); + g_object_set (compressor, "file-info", info, NULL); + info2 = g_zlib_compressor_get_file_info (G_ZLIB_COMPRESSOR (compressor)); + g_assert (info == info2); + g_object_unref (info); costream1 = g_converter_output_stream_new (ostream1, compressor); g_assert (g_converter_output_stream_get_converter (G_CONVERTER_OUTPUT_STREAM (costream1)) == compressor); @@ -1003,7 +1011,7 @@ test_converter_pollable (void) if (outptr < expanded_end) { - res = g_output_stream_write (socket_out, + res = g_output_stream_write (socket_out, outptr, MIN (1000, (expanded_end - outptr)), NULL, &error); @@ -1066,6 +1074,8 @@ test_converter_pollable (void) cstream_out = g_converter_output_stream_new (mem_out, compressor); g_object_unref (mem_out); pollable_out = G_POLLABLE_OUTPUT_STREAM (cstream_out); + g_assert (g_pollable_output_stream_can_poll (pollable_out)); + g_assert (g_pollable_output_stream_is_writable (pollable_out)); for (i = 0; i < expanded_size; i++) {