monitor: move subscribe test to monitor tool

This commit is contained in:
Wim Taymans 2015-08-12 09:53:27 +02:00
parent 7cf87d902e
commit e61cbb3931
3 changed files with 19 additions and 13 deletions

2
src/.gitignore vendored
View file

@ -1,3 +1,3 @@
pinos
test-client
test-subscribe
pinos-monitor

View file

@ -122,8 +122,7 @@ noinst_LTLIBRARIES =
TESTS_default =
TESTS_norun = test-client \
test-subscribe
TESTS_norun = test-client
# These tests need a running pinos daemon
TESTS_daemon =
@ -135,10 +134,17 @@ test_client_CFLAGS = $(AM_CFLAGS)
test_client_LDADD = $(AM_LDADD) libpinos-@PINOS_MAJORMINOR@.la
test_client_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
test_subscribe_SOURCES = tests/test-subscribe.c
test_subscribe_CFLAGS = $(AM_CFLAGS)
test_subscribe_LDADD = $(AM_LDADD) libpinos-@PINOS_MAJORMINOR@.la
test_subscribe_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
###################################
# Tools programs #
###################################
bin_PROGRAMS += \
pinos-monitor
pinos_monitor_SOURCES = tools/pinos-monitor.c
pinos_monitor_CFLAGS = $(AM_CFLAGS)
pinos_monitor_LDADD = $(AM_LDADD) libpinos-@PINOS_MAJORMINOR@.la
pinos_monitor_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
###################################
# Client library #

View file

@ -228,19 +228,19 @@ on_state_notify (GObject *gobject,
gpointer user_data)
{
PinosContextState state;
PinosContext *c = PINOS_CONTEXT (gobject);
const GError *error;
g_object_get (gobject, "state", &state, NULL);
g_print ("got context state %d\n", state);
g_object_get (c, "state", &state, NULL);
switch (state) {
case PINOS_CONTEXT_STATE_ERROR:
g_main_loop_quit (loop);
break;
case PINOS_CONTEXT_STATE_READY:
error = pinos_context_get_error (c);
g_print ("context error: %s\n", error->message);
break;
default:
g_print ("context state %d\n", state);
break;
}
}