[farsight2/master] Print the state by name in the test
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:22 PST 2008
---
tests/check/transmitter/nice.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c
index 99a9b40..c85eea9 100644
--- a/tests/check/transmitter/nice.c
+++ b/tests/check/transmitter/nice.c
@@ -166,10 +166,15 @@ _stream_state_notify (GObject *obj, GParamSpec *pspec, gpointer user_data)
{
FsTransmitter *trans = FS_TRANSMITTER (user_data);
FsStreamState state;
+ GEnumClass *enumclass = NULL;
+ GEnumValue *enumvalue = NULL;
g_object_get (obj, "state", &state, NULL);
- g_debug ("Stream state is now %u", state);
+ enumclass = g_type_class_ref (FS_TYPE_STREAM_STATE);
+ enumvalue = g_enum_get_value (enumclass, state);
+ g_debug ("Stream state is now %s (%u)", enumvalue->value_nick, state);
+ g_type_class_unref (enumclass);
ts_fail_if (state == FS_STREAM_STATE_FAILED,
"Failed to establish a connection");
--
1.5.6.5
More information about the farsight-commits
mailing list