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 pinos
test-client test-client
test-subscribe pinos-monitor

View file

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

View file

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