diff options
author | Brendan Taylor <whateley@gmail.com> | 2009-10-14 18:32:38 -0600 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2009-10-14 18:32:38 -0600 |
commit | 2ff6b2e51b1431f9698ceb46f5f3310541dce120 (patch) | |
tree | f68ff9ef03c6afcca3109b08fd4a5be61ea169fd /tests | |
parent | ab50c5241f32d6b9c28df33ff419ef10b6ba4071 (diff) |
fixed test-command (clientchan -> client_chan)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-command.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test-command.c b/tests/test-command.c index bd1252a..239803c 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -97,8 +97,15 @@ event_fixture_setup(struct EventFixture *ef, const void* data) /* attach uzbl_sock to uzbl's event dispatcher. */ uzbl.comm.socket_path = "/tmp/some-nonexistant-socket"; - uzbl.comm.clientchan = g_io_channel_unix_new(ef->uzbl_sock); - g_io_channel_set_encoding(uzbl.comm.clientchan, NULL, NULL); + + GIOChannel *iochan = g_io_channel_unix_new(ef->uzbl_sock); + g_io_channel_set_encoding(iochan, NULL, NULL); + + if(!uzbl.comm.connect_chan) + uzbl.comm.connect_chan = g_ptr_array_new(); + if(!uzbl.comm.client_chan) + uzbl.comm.client_chan = g_ptr_array_new(); + g_ptr_array_add(uzbl.comm.client_chan, (gpointer)iochan); } void @@ -110,8 +117,8 @@ event_fixture_teardown(struct EventFixture *ef, const void *data) assert_no_event(ef); /* clean up the io channel we opened for uzbl */ - g_io_channel_shutdown(uzbl.comm.clientchan, FALSE, NULL); - g_io_channel_unref(uzbl.comm.clientchan); + GIOChannel *iochan = g_ptr_array_index(uzbl.comm.client_chan, 0); + remove_socket_from_array(iochan); /* close the sockets so that nothing sticks around between tests */ close(ef->uzbl_sock); |