mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Improve test coverage for GZipCompressor
This commit is contained in:
parent
2f3f270fcc
commit
49d39633d1
@ -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++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user