Merge lp:~ted/dbus-test-runner/mass-bustling into lp:dbus-test-runner/0.1

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ted/dbus-test-runner/mass-bustling
Merge into: lp:dbus-test-runner/0.1
Diff against target: 85 lines (+36/-25)
2 files modified
src/dbus-test-runner.c (+18/-25)
tests/Makefile.am (+18/-0)
To merge this branch: bzr merge lp:~ted/dbus-test-runner/mass-bustling
Reviewer Review Type Date Requested Status
Cody Russell (community) Approve
Review via email: mp+15911@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Fixes a bug where when enough bustle data accumulates it caused dbus-test-runner to hang. Also added a test to generate enough data that it can be checked.

Revision history for this message
Cody Russell (bratsche) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dbus-test-runner.c'
2--- src/dbus-test-runner.c 2009-12-08 05:26:05 +0000
3+++ src/dbus-test-runner.c 2009-12-10 02:37:10 +0000
4@@ -66,34 +66,27 @@
5 static gboolean
6 bustle_writes (GIOChannel * channel, GIOCondition condition, gpointer data)
7 {
8- g_debug("Bustle write");
9 gchar * line;
10 gsize termloc;
11
12- do {
13- GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);
14-
15- if (status == G_IO_STATUS_EOF) {
16- continue;
17- }
18-
19- if (status != G_IO_STATUS_NORMAL) {
20- continue;
21- }
22-
23- g_io_channel_write_chars((GIOChannel *)data,
24- line,
25- termloc,
26- NULL,
27- NULL);
28- g_io_channel_write_chars((GIOChannel *)data,
29- "\n",
30- 1,
31- NULL,
32- NULL);
33-
34- g_free(line);
35- } while ((G_IO_IN | G_IO_PRI) & g_io_channel_get_buffer_condition(channel));
36+ GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);
37+
38+ if (status != G_IO_STATUS_NORMAL) {
39+ return FALSE;
40+ }
41+
42+ g_io_channel_write_chars((GIOChannel *)data,
43+ line,
44+ termloc,
45+ NULL,
46+ NULL);
47+ g_io_channel_write_chars((GIOChannel *)data,
48+ "\n",
49+ 1,
50+ NULL,
51+ NULL);
52+
53+ g_free(line);
54
55 return TRUE;
56 }
57
58=== modified file 'tests/Makefile.am'
59--- tests/Makefile.am 2009-12-08 05:22:06 +0000
60+++ tests/Makefile.am 2009-12-10 02:37:10 +0000
61@@ -73,6 +73,24 @@
62 @chmod +x $@
63 DISTCLEANFILES += test-bustle.bustle test-bustle.filtered
64
65+TESTS += test-bustle-data
66+test-bustle-data: Makefile.am
67+ @echo "#!/bin/sh -e" > $@
68+ @echo "$(DBUS_RUNNER) --bustle-data \"$(builddir)/test-bustle-data.bustle\" \\" >> $@
69+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
70+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
71+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
72+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
73+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
74+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
75+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
76+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
77+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
78+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
79+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
80+ @chmod +x $@
81+DISTCLEANFILES += test-bustle-data.bustle
82+
83
84 EXTRA_DIST = \
85 delayrm.sh \

Subscribers

People subscribed via source and target branches