ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #00678
[Branch ~indicator-applet-developers/dbus-test-runner/trunk] Rev 24: Handling the cases where the bustle process sends out data without a loop. Fixes a bug. Add a t...
Merge authors:
Ted Gould (ted)
Related merge proposals:
https://code.launchpad.net/~ted/dbus-test-runner/mass-bustling/+merge/15911
proposed by: Ted Gould (ted)
review: Approve - Cody Russell (bratsche)
------------------------------------------------------------
revno: 24 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-12-09 22:44:49 -0600
message:
Handling the cases where the bustle process sends out data without a loop. Fixes a bug. Add a test to recreate the bug.
modified:
src/dbus-test-runner.c
tests/Makefile.am
--
lp:dbus-test-runner
https://code.launchpad.net/~indicator-applet-developers/dbus-test-runner/trunk
Your team ayatana-commits is subscribed to branch lp:dbus-test-runner.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/dbus-test-runner/trunk/+edit-subscription.
=== 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:34:40 +0000
@@ -66,34 +66,27 @@
static gboolean
bustle_writes (GIOChannel * channel, GIOCondition condition, gpointer data)
{
- g_debug("Bustle write");
gchar * line;
gsize termloc;
- do {
- GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);
-
- if (status == G_IO_STATUS_EOF) {
- continue;
- }
-
- if (status != G_IO_STATUS_NORMAL) {
- continue;
- }
-
- g_io_channel_write_chars((GIOChannel *)data,
- line,
- termloc,
- NULL,
- NULL);
- g_io_channel_write_chars((GIOChannel *)data,
- "\n",
- 1,
- NULL,
- NULL);
-
- g_free(line);
- } while ((G_IO_IN | G_IO_PRI) & g_io_channel_get_buffer_condition(channel));
+ GIOStatus status = g_io_channel_read_line (channel, &line, NULL, &termloc, NULL);
+
+ if (status != G_IO_STATUS_NORMAL) {
+ return FALSE;
+ }
+
+ g_io_channel_write_chars((GIOChannel *)data,
+ line,
+ termloc,
+ NULL,
+ NULL);
+ g_io_channel_write_chars((GIOChannel *)data,
+ "\n",
+ 1,
+ NULL,
+ NULL);
+
+ g_free(line);
return TRUE;
}
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2009-12-08 05:22:06 +0000
+++ tests/Makefile.am 2009-12-10 02:23:50 +0000
@@ -73,6 +73,24 @@
@chmod +x $@
DISTCLEANFILES += test-bustle.bustle test-bustle.filtered
+TESTS += test-bustle-data
+test-bustle-data: Makefile.am
+ @echo "#!/bin/sh -e" > $@
+ @echo "$(DBUS_RUNNER) --bustle-data \"$(builddir)/test-bustle-data.bustle\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @echo "--task dbus-send -p \"--session\" -p \"--print-reply\" -p \"--dest=org.freedesktop.DBus\" -p \"/org/freedesktop/DBus\" -p \"org.freedesktop.DBus.ListNames\" \\" >> $@
+ @chmod +x $@
+DISTCLEANFILES += test-bustle-data.bustle
+
EXTRA_DIST = \
delayrm.sh \