summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVictor Toso <victortoso@redhat.com>2015-05-25 17:02:53 +0200
committerVictor Toso <victortoso@redhat.com>2015-06-05 09:22:32 +0200
commite5d2047812412bc7d5e11cfb63a4d8b55551a408 (patch)
tree4022dce483d6b9032eb63881bf0484e1d10a3681 /tests
parent33d4016228798108250b0ef9173f2c4c719a5065 (diff)
tests: remove read8_cb to use generic read_cb
Both functions are basic the same so let's keep the generic one.
Diffstat (limited to 'tests')
-rw-r--r--tests/pipe.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/pipe.c b/tests/pipe.c
index 841cb77..ec11b6f 100644
--- a/tests/pipe.c
+++ b/tests/pipe.c
@@ -160,26 +160,12 @@ test_pipe_readwrite(Fixture *f, gconstpointer user_data)
}
static void
-read8_cb(GObject *source, GAsyncResult *result, gpointer user_data)
-{
- GError *error = NULL;
- gssize nbytes;
- GMainLoop *loop = user_data;
-
- nbytes = g_input_stream_read_finish(G_INPUT_STREAM(source), result, &error);
-
- g_assert_cmpint(nbytes, ==, 8);
- g_assert_no_error(error);
- g_clear_error(&error);
-}
-
-static void
test_pipe_write16read8(Fixture *f, gconstpointer user_data)
{
g_output_stream_write_async(f->op1, "0123456789abcdef", 16, G_PRIORITY_DEFAULT,
f->cancellable, write_cb, f->loop);
g_input_stream_read_async(f->ip2, f->buf, 8, G_PRIORITY_DEFAULT,
- f->cancellable, read8_cb, GINT_TO_POINTER(8));
+ f->cancellable, read_cb, GINT_TO_POINTER(8));
g_main_loop_run (f->loop);
@@ -193,7 +179,7 @@ test_pipe_write8read16(Fixture *f, gconstpointer user_data)
g_output_stream_write_async(f->op1, "01234567", 8, G_PRIORITY_DEFAULT,
f->cancellable, write_cb, f->loop);
g_input_stream_read_async(f->ip2, f->buf, 16, G_PRIORITY_DEFAULT,
- f->cancellable, read8_cb, GINT_TO_POINTER(8));
+ f->cancellable, read_cb, GINT_TO_POINTER(8));
g_main_loop_run (f->loop);