mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 13:23:07 +02: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;
|
GConverter *compressor, *decompressor;
|
||||||
GZlibCompressorFormat fmt;
|
GZlibCompressorFormat fmt;
|
||||||
gint lvl;
|
gint lvl;
|
||||||
|
GFileInfo *info;
|
||||||
|
GFileInfo *info2;
|
||||||
|
|
||||||
g_test_bug ("619945");
|
g_test_bug ("619945");
|
||||||
|
|
||||||
@ -759,6 +761,12 @@ test_roundtrip (gconstpointer data)
|
|||||||
|
|
||||||
ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
|
ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
|
||||||
compressor = G_CONVERTER (g_zlib_compressor_new (test->format, test->level));
|
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);
|
costream1 = g_converter_output_stream_new (ostream1, compressor);
|
||||||
g_assert (g_converter_output_stream_get_converter (G_CONVERTER_OUTPUT_STREAM (costream1)) == 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)
|
if (outptr < expanded_end)
|
||||||
{
|
{
|
||||||
res = g_output_stream_write (socket_out,
|
res = g_output_stream_write (socket_out,
|
||||||
outptr,
|
outptr,
|
||||||
MIN (1000, (expanded_end - outptr)),
|
MIN (1000, (expanded_end - outptr)),
|
||||||
NULL, &error);
|
NULL, &error);
|
||||||
@ -1066,6 +1074,8 @@ test_converter_pollable (void)
|
|||||||
cstream_out = g_converter_output_stream_new (mem_out, compressor);
|
cstream_out = g_converter_output_stream_new (mem_out, compressor);
|
||||||
g_object_unref (mem_out);
|
g_object_unref (mem_out);
|
||||||
pollable_out = G_POLLABLE_OUTPUT_STREAM (cstream_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++)
|
for (i = 0; i < expanded_size; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user