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

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~ted/dbus-test-runner/mass-bustling
Merge into: lp://staging/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://staging/~ted/dbus-test-runner/mass-bustling
Reviewer Review Type Date Requested Status
Cody Russell (community) Approve
Review via email: mp+15911@code.staging.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
=== modified file 'src/dbus-test-runner.c'
--- src/dbus-test-runner.c 2009-12-08 05:26:05 +0000
+++ src/dbus-test-runner.c 2009-12-10 02:37:10 +0000
@@ -66,34 +66,27 @@
66static gboolean66static gboolean
67bustle_writes (GIOChannel * channel, GIOCondition condition, gpointer data)67bustle_writes (GIOChannel * channel, GIOCondition condition, gpointer data)
68{68{
69 g_debug("Bustle write");
70 gchar * line;69 gchar * line;
71 gsize termloc;70 gsize termloc;
7271
73 do {72 GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);
74 GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);73
7574 if (status != G_IO_STATUS_NORMAL) {
76 if (status == G_IO_STATUS_EOF) {75 return FALSE;
77 continue;76 }
78 }77
7978 g_io_channel_write_chars((GIOChannel *)data,
80 if (status != G_IO_STATUS_NORMAL) {79 line,
81 continue;80 termloc,
82 }81 NULL,
8382 NULL);
84 g_io_channel_write_chars((GIOChannel *)data,83 g_io_channel_write_chars((GIOChannel *)data,
85 line,84 "\n",
86 termloc,85 1,
87 NULL,86 NULL,
88 NULL);87 NULL);
89 g_io_channel_write_chars((GIOChannel *)data,88
90 "\n",89 g_free(line);
91 1,
92 NULL,
93 NULL);
94
95 g_free(line);
96 } while ((G_IO_IN | G_IO_PRI) & g_io_channel_get_buffer_condition(channel));
9790
98 return TRUE;91 return TRUE;
99}92}
10093
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2009-12-08 05:22:06 +0000
+++ tests/Makefile.am 2009-12-10 02:37:10 +0000
@@ -73,6 +73,24 @@
73 @chmod +x $@73 @chmod +x $@
74DISTCLEANFILES += test-bustle.bustle test-bustle.filtered74DISTCLEANFILES += test-bustle.bustle test-bustle.filtered
7575
76TESTS += test-bustle-data
77test-bustle-data: Makefile.am
78 @echo "#!/bin/sh -e" > $@
79 @echo "$(DBUS_RUNNER) --bustle-data \"$(builddir)/test-bustle-data.bustle\" \\" >> $@
80 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
81 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
82 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
83 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
84 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
85 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
86 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
87 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
88 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
89 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
90 @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
91 @chmod +x $@
92DISTCLEANFILES += test-bustle-data.bustle
93
7694
77EXTRA_DIST = \95EXTRA_DIST = \
78 delayrm.sh \96 delayrm.sh \

Subscribers

People subscribed via source and target branches