From fa946df247f0e16de3a355dd5696f4671277348a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 12:18:23 -0400 Subject: Adding in a tests folder --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/Makefile.am (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..8ac6544 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1 @@ +#Something should go here -- cgit v1.2.3 From c314d6040b93da70359e19a8b7475c94fc86fb1c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 12:29:12 -0400 Subject: Adding in a simple little test. --- tests/Makefile.am | 25 ++++++++++++++++++++++++- tests/test-loader.c | 7 +++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/test-loader.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8ac6544..a04855c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1 +1,24 @@ -#Something should go here + +noinst_PROGRAMS = \ + test-loader + +test_loader_SOURCES = \ + test-loader.c + +test_loader_CFLAGS = \ + -Wall -Werror \ + $(UPANEL_CFLAGS) -I$(top_srcdir) + +test_loader_LDADD = \ + $(UPANEL_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a + +XML_REPORT = loader-check-results.xml +HTML_REPORT = loader-check-results.html + +loader-tester: test-loader + @gtester -o=$(XML_REPORT) ./test-loader + +check-local: loader-tester + +DISTCLEANFILES = $(XML_REPORT) $(HTML_REPORT) + diff --git a/tests/test-loader.c b/tests/test-loader.c new file mode 100644 index 0000000..63590c7 --- /dev/null +++ b/tests/test-loader.c @@ -0,0 +1,7 @@ + +int +main (int argc, char ** argv) +{ + + return 0; +} -- cgit v1.2.3 From 1386478a87fd0f228dd31a00d8f3d969d6a6a98c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 13:00:00 -0400 Subject: Fleshing out the test a little bit. --- tests/Makefile.am | 6 +++--- tests/test-loader.c | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index a04855c..2779ad7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ -noinst_PROGRAMS = \ +check_PROGRAMS = \ test-loader test_loader_SOURCES = \ @@ -7,10 +7,10 @@ test_loader_SOURCES = \ test_loader_CFLAGS = \ -Wall -Werror \ - $(UPANEL_CFLAGS) -I$(top_srcdir) + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) test_loader_LDADD = \ - $(UPANEL_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a + $(LIBINDICATOR_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html diff --git a/tests/test-loader.c b/tests/test-loader.c index 63590c7..7e77195 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,7 +1,29 @@ +#include +#include "libindicator/indicator-object.h" + +void +test_loader_refunref (void) +{ + + return; +} + +void +test_loader_creation_deletion_suite (void) +{ + g_test_add_func ("/libindicator/loader/ref_and_unref", test_loader_refunref); + + return; +} + int main (int argc, char ** argv) { + g_type_init (); + g_test_init (&argc, &argv, NULL); + + test_loader_creation_deletion_suite(); - return 0; + return g_test_run(); } -- cgit v1.2.3 From 4658844f6c1d0e4352ee7baf0e7fcf56bde01d10 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 16:29:36 -0400 Subject: Test to build the object and unref it. --- tests/test-loader.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 7e77195..68bfe48 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,9 +1,25 @@ #include #include "libindicator/indicator-object.h" +void +destroy_cb (gpointer data) +{ + gboolean * bob = (gboolean *)data; + *bob = TRUE; + return; +} + void test_loader_refunref (void) { + GObject * object = g_object_new(INDICATOR_OBJECT_TYPE, NULL); + + gboolean unreffed = FALSE; + g_signal_connect(object, "destroy", G_CALLBACK(destroy_cb), &unreffed); + + g_object_unref(object); + + g_assert(unreffed == TRUE); return; } -- cgit v1.2.3 From 26ced5cdf75d022c4b40cc3ef8658bf486a0dba1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 16:34:13 -0400 Subject: Using a weak ref instead of connecting to a signal that doesn't exist --- tests/test-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 68bfe48..f754685 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -2,7 +2,7 @@ #include "libindicator/indicator-object.h" void -destroy_cb (gpointer data) +destroy_cb (gpointer data, GObject * object) { gboolean * bob = (gboolean *)data; *bob = TRUE; @@ -15,7 +15,7 @@ test_loader_refunref (void) GObject * object = g_object_new(INDICATOR_OBJECT_TYPE, NULL); gboolean unreffed = FALSE; - g_signal_connect(object, "destroy", G_CALLBACK(destroy_cb), &unreffed); + g_object_weak_ref(object, destroy_cb, &unreffed); g_object_unref(object); -- cgit v1.2.3 From c594126850cb7b59294069f2711fa0a5d96febbb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 17:03:20 -0400 Subject: Creating a dummy indicator that returns null --- tests/Makefile.am | 31 ++++++++++++++++++++++++++++++- tests/dummy-indicator-null.c | 23 +++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/dummy-indicator-null.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 2779ad7..ad5e5c6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,6 +2,13 @@ check_PROGRAMS = \ test-loader +check_LTLIBRARIES = \ + libdummy-indicator-null.la + +############################# +# Test Loader +############################# + test_loader_SOURCES = \ test-loader.c @@ -12,10 +19,32 @@ test_loader_CFLAGS = \ test_loader_LDADD = \ $(LIBINDICATOR_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a +############################# +# Dummy Indicator +############################# + +libdummy_indicator_null_la_SOURCES = \ + dummy-indicator-null.c + +libdummy_indicator_null_la_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +libdummy_indicator_null_la_LIBADD = \ + $(LIBINDICATOR_LIBS) + +libdummy_indicator_null_la_LDFLAGS = \ + -module \ + -avoid-version + +############################# +# Test stuff +############################# + XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html -loader-tester: test-loader +loader-tester: test-loader libdummy-indicator-null.la @gtester -o=$(XML_REPORT) ./test-loader check-local: loader-tester diff --git a/tests/dummy-indicator-null.c b/tests/dummy-indicator-null.c new file mode 100644 index 0000000..ff99d71 --- /dev/null +++ b/tests/dummy-indicator-null.c @@ -0,0 +1,23 @@ + +#include "libindicator/indicator.h" + +INDICATOR_SET_VERSION +INDICATOR_SET_NAME("dummy-indicator-null") + +GtkLabel * +get_label (void) +{ + return NULL; +} + +GtkImage * +get_icon (void) +{ + return NULL; +} + +GtkMenu * +get_menu (void) +{ + return NULL; +} -- cgit v1.2.3 From d946049ea36d1c6a0946750655eac070566f4974 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 17:11:47 -0400 Subject: Adding a test that should pass as given a bad filename we should get no object back. --- tests/test-loader.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index f754685..85cb924 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,6 +1,14 @@ #include #include "libindicator/indicator-object.h" +void +test_loader_filename_bad (void) +{ + IndicatorObject * object = indicator_object_new_from_file("/this/file/should/not/exist.so"); + g_assert(object == NULL); + return; +} + void destroy_cb (gpointer data, GObject * object) { @@ -28,6 +36,7 @@ void test_loader_creation_deletion_suite (void) { g_test_add_func ("/libindicator/loader/ref_and_unref", test_loader_refunref); + g_test_add_func ("/libindicator/loader/filename_bad", test_loader_filename_bad); return; } -- cgit v1.2.3 From 1b828c9f669ce1364618387d13fc8a134244e2ba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 17:53:01 -0400 Subject: Apparently they have to be installable to get the .so. Fail. --- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index ad5e5c6..52cc224 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,7 @@ check_PROGRAMS = \ test-loader -check_LTLIBRARIES = \ +lib_LTLIBRARIES = \ libdummy-indicator-null.la ############################# -- cgit v1.2.3 From bce9f5143bfbe49972aebe3fa3e0a4566e2502b7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 17:57:14 -0400 Subject: A test to load the dummy indicator --- tests/test-loader.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 85cb924..3e94981 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,6 +1,23 @@ #include #include "libindicator/indicator-object.h" +void destroy_cb (gpointer data, GObject * object); + +void +test_loader_filename_dummy_null (void) +{ + IndicatorObject * object = indicator_object_new_from_file("./.libs/libdummy-indicator-null.so"); + g_assert(object != NULL); + + gboolean unreffed = FALSE; + g_object_weak_ref(G_OBJECT(object), destroy_cb, &unreffed); + + g_object_unref(object); + g_assert(unreffed == TRUE); + + return; +} + void test_loader_filename_bad (void) { @@ -37,6 +54,7 @@ test_loader_creation_deletion_suite (void) { g_test_add_func ("/libindicator/loader/ref_and_unref", test_loader_refunref); g_test_add_func ("/libindicator/loader/filename_bad", test_loader_filename_bad); + g_test_add_func ("/libindicator/loader/dummy/null_load", test_loader_filename_dummy_null); return; } -- cgit v1.2.3 From 376658695b00a0d272b9463722a9d7914a7d7ffc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 18:48:59 -0400 Subject: Build dir fix and making gtester run all of them even if one fails. --- tests/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 52cc224..2048a9a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,7 +14,8 @@ test_loader_SOURCES = \ test_loader_CFLAGS = \ -Wall -Werror \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) \ + -DBUILD_DIR="\"$(builddir)\"" test_loader_LDADD = \ $(LIBINDICATOR_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a @@ -45,7 +46,7 @@ XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html loader-tester: test-loader libdummy-indicator-null.la - @gtester -o=$(XML_REPORT) ./test-loader + @gtester -k -o=$(XML_REPORT) ./test-loader check-local: loader-tester -- cgit v1.2.3 From 3bafca747c5c9a1508bc93fdcf9efa77af99710b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 18:49:08 -0400 Subject: Use the new build dir flag --- tests/test-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 3e94981..16c0292 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -6,7 +6,7 @@ void destroy_cb (gpointer data, GObject * object); void test_loader_filename_dummy_null (void) { - IndicatorObject * object = indicator_object_new_from_file("./.libs/libdummy-indicator-null.so"); + IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-null.so"); g_assert(object != NULL); gboolean unreffed = FALSE; -- cgit v1.2.3 From 56450cfd530c876adc4ad33b1a5ab53a6a6078fa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 19:49:23 -0400 Subject: Making it so that the null test checks for failure as we shoudln't have a null image and label. Also making it so that warnings don't cause the test to fail. --- tests/test-loader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 16c0292..3dcc595 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -4,9 +4,9 @@ void destroy_cb (gpointer data, GObject * object); void -test_loader_filename_dummy_null (void) +test_loader_filename_dummy_simple (void) { - IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-null.so"); + IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-simple.so"); g_assert(object != NULL); gboolean unreffed = FALSE; @@ -18,6 +18,14 @@ test_loader_filename_dummy_null (void) return; } +void +test_loader_filename_dummy_null (void) +{ + IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-null.so"); + g_assert(object == NULL); + return; +} + void test_loader_filename_bad (void) { @@ -68,5 +76,7 @@ main (int argc, char ** argv) test_loader_creation_deletion_suite(); + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); + return g_test_run(); } -- cgit v1.2.3 From a28e917b914b07de67027c97eb29d533e3fe9393 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 19:50:40 -0400 Subject: Being a bit more verbose --- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 2048a9a..461bb51 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,7 +46,7 @@ XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html loader-tester: test-loader libdummy-indicator-null.la - @gtester -k -o=$(XML_REPORT) ./test-loader + @gtester -k --verbose -o=$(XML_REPORT) ./test-loader check-local: loader-tester -- cgit v1.2.3 From 97a4004d26cd5ebec0b25b51d4793d1df51b5dba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 20:12:48 -0400 Subject: Create a very simple indicator and testing it. --- tests/Makefile.am | 25 ++++++++++++++++++++++--- tests/dummy-indicator-simple.c | 23 +++++++++++++++++++++++ tests/test-loader.c | 1 + 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/dummy-indicator-simple.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 461bb51..c21ff09 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,7 +3,8 @@ check_PROGRAMS = \ test-loader lib_LTLIBRARIES = \ - libdummy-indicator-null.la + libdummy-indicator-null.la \ + libdummy-indicator-simple.la ############################# # Test Loader @@ -21,7 +22,7 @@ test_loader_LDADD = \ $(LIBINDICATOR_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a ############################# -# Dummy Indicator +# Dummy Indicator NULL ############################# libdummy_indicator_null_la_SOURCES = \ @@ -38,6 +39,24 @@ libdummy_indicator_null_la_LDFLAGS = \ -module \ -avoid-version +############################# +# Dummy Indicator Simple +############################# + +libdummy_indicator_simple_la_SOURCES = \ + dummy-indicator-simple.c + +libdummy_indicator_simple_la_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +libdummy_indicator_simple_la_LIBADD = \ + $(LIBINDICATOR_LIBS) + +libdummy_indicator_simple_la_LDFLAGS = \ + -module \ + -avoid-version + ############################# # Test stuff ############################# @@ -45,7 +64,7 @@ libdummy_indicator_null_la_LDFLAGS = \ XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html -loader-tester: test-loader libdummy-indicator-null.la +loader-tester: test-loader libdummy-indicator-null.la libdummy-indicator-simple.la @gtester -k --verbose -o=$(XML_REPORT) ./test-loader check-local: loader-tester diff --git a/tests/dummy-indicator-simple.c b/tests/dummy-indicator-simple.c new file mode 100644 index 0000000..d939141 --- /dev/null +++ b/tests/dummy-indicator-simple.c @@ -0,0 +1,23 @@ + +#include "libindicator/indicator.h" + +INDICATOR_SET_VERSION +INDICATOR_SET_NAME("dummy-indicator-simple") + +GtkLabel * +get_label (void) +{ + return GTK_LABEL(gtk_label_new("Simple Item")); +} + +GtkImage * +get_icon (void) +{ + return GTK_IMAGE(gtk_image_new()); +} + +GtkMenu * +get_menu (void) +{ + return GTK_MENU(gtk_menu_new()); +} diff --git a/tests/test-loader.c b/tests/test-loader.c index 3dcc595..1d6a7c3 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -63,6 +63,7 @@ test_loader_creation_deletion_suite (void) g_test_add_func ("/libindicator/loader/ref_and_unref", test_loader_refunref); g_test_add_func ("/libindicator/loader/filename_bad", test_loader_filename_bad); g_test_add_func ("/libindicator/loader/dummy/null_load", test_loader_filename_dummy_null); + g_test_add_func ("/libindicator/loader/dummy/simple_load", test_loader_filename_dummy_simple); return; } -- cgit v1.2.3 From 9c16e7c9708c757c46be1e96d58ab6430d729b0a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 20:17:04 -0400 Subject: A better dummy menu. --- tests/dummy-indicator-simple.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/dummy-indicator-simple.c b/tests/dummy-indicator-simple.c index d939141..cee4eac 100644 --- a/tests/dummy-indicator-simple.c +++ b/tests/dummy-indicator-simple.c @@ -19,5 +19,10 @@ get_icon (void) GtkMenu * get_menu (void) { - return GTK_MENU(gtk_menu_new()); + GtkMenu * main_menu = GTK_MENU(gtk_menu_new()); + GtkWidget * loading_item = gtk_menu_item_new_with_label("Loading..."); + gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), loading_item); + gtk_widget_show(GTK_WIDGET(loading_item)); + + return main_menu; } -- cgit v1.2.3 From 32fc4b833fd948270eaa16f33d5b80eafef6f281 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 20:18:20 -0400 Subject: We need to use GTK. --- tests/test-loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 1d6a7c3..0409a6f 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,4 +1,4 @@ -#include +#include #include "libindicator/indicator-object.h" void destroy_cb (gpointer data, GObject * object); @@ -74,6 +74,7 @@ main (int argc, char ** argv) { g_type_init (); g_test_init (&argc, &argv, NULL); + gtk_init(&argc, &argv); test_loader_creation_deletion_suite(); -- cgit v1.2.3 From bb7b49ae82deb1f551ec8892511e4a19c881f6cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 21:03:30 -0400 Subject: Testing the accessors --- tests/test-loader.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index 0409a6f..ecbf502 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -3,6 +3,21 @@ void destroy_cb (gpointer data, GObject * object); +void +test_loader_filename_dummy_simple_accessors (void) +{ + IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-simple.so"); + g_assert(object != NULL); + + g_assert(indicator_object_get_label(object) != NULL); + g_assert(indicator_object_get_menu(object) != NULL); + g_assert(indicator_object_get_icon(object) != NULL); + + g_object_unref(object); + + return; +} + void test_loader_filename_dummy_simple (void) { @@ -64,6 +79,7 @@ test_loader_creation_deletion_suite (void) g_test_add_func ("/libindicator/loader/filename_bad", test_loader_filename_bad); g_test_add_func ("/libindicator/loader/dummy/null_load", test_loader_filename_dummy_null); g_test_add_func ("/libindicator/loader/dummy/simple_load", test_loader_filename_dummy_simple); + g_test_add_func ("/libindicator/loader/dummy/simple_accessors", test_loader_filename_dummy_simple_accessors); return; } -- cgit v1.2.3 From a2f4f868e8744fd6aea1ffb0b335e70c54e039ea Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 11 Oct 2009 21:49:22 -0500 Subject: Building a new dummy indicator that doesn't have any symbols in it. --- tests/Makefile.am | 19 +++++++++++++++++++ tests/dummy-indicator-blank.c | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/dummy-indicator-blank.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index c21ff09..8121136 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,7 @@ check_PROGRAMS = \ test-loader lib_LTLIBRARIES = \ + libdummy-indicator-blank.la \ libdummy-indicator-null.la \ libdummy-indicator-simple.la @@ -21,6 +22,24 @@ test_loader_CFLAGS = \ test_loader_LDADD = \ $(LIBINDICATOR_LIBS) $(top_builddir)/libindicator/.libs/libindicator.a +############################# +# Dummy Indicator Blank +############################# + +libdummy_indicator_blank_la_SOURCES = \ + dummy-indicator-blank.c + +libdummy_indicator_blank_la_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +libdummy_indicator_blank_la_LIBADD = \ + $(LIBINDICATOR_LIBS) + +libdummy_indicator_blank_la_LDFLAGS = \ + -module \ + -avoid-version + ############################# # Dummy Indicator NULL ############################# diff --git a/tests/dummy-indicator-blank.c b/tests/dummy-indicator-blank.c new file mode 100644 index 0000000..41249f2 --- /dev/null +++ b/tests/dummy-indicator-blank.c @@ -0,0 +1,6 @@ + +#include "libindicator/indicator.h" + +INDICATOR_SET_VERSION +INDICATOR_SET_NAME("dummy-indicator-null") + -- cgit v1.2.3 From ccc7f82c202d8f0691fbbfbdd36d08624ae44e0c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 11 Oct 2009 21:50:46 -0500 Subject: using the blank dummy indicator --- tests/test-loader.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/test-loader.c b/tests/test-loader.c index ecbf502..4b2b096 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -33,6 +33,14 @@ test_loader_filename_dummy_simple (void) return; } +void +test_loader_filename_dummy_blank (void) +{ + IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-blank.so"); + g_assert(object == NULL); + return; +} + void test_loader_filename_dummy_null (void) { @@ -78,6 +86,7 @@ test_loader_creation_deletion_suite (void) g_test_add_func ("/libindicator/loader/ref_and_unref", test_loader_refunref); g_test_add_func ("/libindicator/loader/filename_bad", test_loader_filename_bad); g_test_add_func ("/libindicator/loader/dummy/null_load", test_loader_filename_dummy_null); + g_test_add_func ("/libindicator/loader/dummy/blank_load", test_loader_filename_dummy_null); g_test_add_func ("/libindicator/loader/dummy/simple_load", test_loader_filename_dummy_simple); g_test_add_func ("/libindicator/loader/dummy/simple_accessors", test_loader_filename_dummy_simple_accessors); -- cgit v1.2.3 From fc573dc11ca279d7a6aaf3c5164fb6e772f8d37c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 11:34:44 -0500 Subject: Creating a new test and linking it into things. --- tests/Makefile.am | 18 +++++++++++++++- tests/service-shutdown-timeout.c | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 tests/service-shutdown-timeout.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8121136..fc83186 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ check_PROGRAMS = \ - test-loader + test-loader \ + service-shutdown-timeout lib_LTLIBRARIES = \ libdummy-indicator-blank.la \ @@ -76,6 +77,21 @@ libdummy_indicator_simple_la_LDFLAGS = \ -module \ -avoid-version +############################# +# Service Shutdown Timeout +############################# + +service_shutdown_timeout_SOURCES = \ + service-shutdown-timeout.c + +service_shutdown_timeout_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +service_shutdown_timeout_LDADD = \ + $(LIBINDICATOR_LIBS) \ + $(top_builddir)/libindicator/.libs/libindicator.a + ############################# # Test stuff ############################# diff --git a/tests/service-shutdown-timeout.c b/tests/service-shutdown-timeout.c new file mode 100644 index 0000000..9682202 --- /dev/null +++ b/tests/service-shutdown-timeout.c @@ -0,0 +1,45 @@ + +#include +#include "libindicator/indicator-service.h" + +static GMainLoop * mainloop = NULL; +static gboolean passed = FALSE; + +gboolean +timeout (gpointer data) +{ + passed = FALSE; + g_error("Timeout with no shutdown."); + g_main_loop_quit(mainloop); + return FALSE; +} + +void +shutdown (void) +{ + g_debug("Shutdown"); + g_main_loop_quit(mainloop); + return; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicatorService * is = indicator_service_new("my.test.name"); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL); + + g_timeout_add_seconds(1, timeout, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + if (passed) { + g_debug("Passed"); + return 0; + } + g_debug("Failed"); + return 1; +} -- cgit v1.2.3 From a72fc583b5ae76ee0d4183ae72e4d905c0304bb7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 12:57:56 -0500 Subject: Making the gtester stuff into a autotest thingy. --- tests/Makefile.am | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index fc83186..bacdce6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,5 @@ +TESTS = +DISTCLEANFILES = check_PROGRAMS = \ test-loader \ @@ -99,10 +101,13 @@ service_shutdown_timeout_LDADD = \ XML_REPORT = loader-check-results.xml HTML_REPORT = loader-check-results.html -loader-tester: test-loader libdummy-indicator-null.la libdummy-indicator-simple.la - @gtester -k --verbose -o=$(XML_REPORT) ./test-loader +loader-tester: test-loader libdummy-indicator-null.la libdummy-indicator-simple.la Makefile + @echo "#!/bin/sh" > loader-tester + @echo gtester -k --verbose -o=$(XML_REPORT) ./test-loader >> loader-tester + @chmod +x loader-tester -check-local: loader-tester +TESTS += loader-tester +DISTCLEANFILES += loader-tester -DISTCLEANFILES = $(XML_REPORT) $(HTML_REPORT) +DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) -- cgit v1.2.3 From 22a5b08a9ddb76888f580141617d67a319fbfad9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 13:03:39 -0500 Subject: Woot! A failing test. Look how TDD I am. --- tests/Makefile.am | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index bacdce6..485d02e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,6 +10,8 @@ lib_LTLIBRARIES = \ libdummy-indicator-null.la \ libdummy-indicator-simple.la +DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf + ############################# # Test Loader ############################# @@ -94,6 +96,14 @@ service_shutdown_timeout_LDADD = \ $(LIBINDICATOR_LIBS) \ $(top_builddir)/libindicator/.libs/libindicator.a +service-shutdown-timeout-tester: service-shutdown-timeout Makefile + @echo "#!/bin/sh" > service-shutdown-timeout-tester + @echo $(DBUS_RUNNER) --task ./service-shutdown-timeout >> service-shutdown-timeout-tester + @chmod +x service-shutdown-timeout-tester + +TESTS += service-shutdown-timeout-tester +DISTCLEANFILES += service-shutdown-timeout-tester + ############################# # Test stuff ############################# -- cgit v1.2.3 From 74296a68665e9c582c37a61894a9c1ba1630cb9d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 17:22:29 -0500 Subject: Oops, forgot to set to passed. --- tests/service-shutdown-timeout.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/service-shutdown-timeout.c b/tests/service-shutdown-timeout.c index 9682202..666739a 100644 --- a/tests/service-shutdown-timeout.c +++ b/tests/service-shutdown-timeout.c @@ -18,6 +18,7 @@ void shutdown (void) { g_debug("Shutdown"); + passed = TRUE; g_main_loop_quit(mainloop); return; } -- cgit v1.2.3 From 911b9d7f93b4319665b5fa63b84032df230412ba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 30 Oct 2009 17:18:10 -0500 Subject: Adding a test that ensures we don't get a connect signal. --- tests/Makefile.am | 24 ++++++++++++++++++++ tests/service-manager-no-connect.c | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/service-manager-no-connect.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 485d02e..dd047d3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,7 @@ DISTCLEANFILES = check_PROGRAMS = \ test-loader \ + service-manager-no-connect \ service-shutdown-timeout lib_LTLIBRARIES = \ @@ -104,6 +105,29 @@ service-shutdown-timeout-tester: service-shutdown-timeout Makefile TESTS += service-shutdown-timeout-tester DISTCLEANFILES += service-shutdown-timeout-tester +############################# +# Service Manager No Connect +############################# + +service_manager_no_connect_SOURCES = \ + service-manager-no-connect.c + +service_manager_no_connect_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +service_manager_no_connect_LDADD = \ + $(LIBINDICATOR_LIBS) \ + $(top_builddir)/libindicator/.libs/libindicator.a + +service-manager-no-connect-tester: service-manager-no-connect Makefile + @echo "#!/bin/sh" > service-manager-no-connect-tester + @echo $(DBUS_RUNNER) --task ./service-manager-no-connect >> service-manager-no-connect-tester + @chmod +x service-manager-no-connect-tester + +TESTS += service-manager-no-connect-tester +DISTCLEANFILES += service-manager-no-connect-tester + ############################# # Test stuff ############################# diff --git a/tests/service-manager-no-connect.c b/tests/service-manager-no-connect.c new file mode 100644 index 0000000..8006eda --- /dev/null +++ b/tests/service-manager-no-connect.c @@ -0,0 +1,46 @@ + +#include +#include "libindicator/indicator-service-manager.h" + +static GMainLoop * mainloop = NULL; +static gboolean passed = FALSE; + +gboolean +timeout (gpointer data) +{ + passed = TRUE; + g_error("Timeout with no connection."); + g_main_loop_quit(mainloop); + return FALSE; +} + +void +connection (void) +{ + g_debug("Connection"); + passed = FALSE; + g_main_loop_quit(mainloop); + return; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicatorServiceManager * is = indicator_service_manager_new("my.test.name"); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL); + + g_timeout_add_seconds(1, timeout, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + if (passed) { + g_debug("Passed"); + return 0; + } + g_debug("Failed"); + return 1; +} -- cgit v1.2.3 From 0745e42d7032a400e1661da94faef05de7be7527 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 09:31:43 -0600 Subject: Ah, we can't throw an error on success. --- tests/service-manager-no-connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/service-manager-no-connect.c b/tests/service-manager-no-connect.c index 8006eda..1c32eb2 100644 --- a/tests/service-manager-no-connect.c +++ b/tests/service-manager-no-connect.c @@ -9,7 +9,7 @@ gboolean timeout (gpointer data) { passed = TRUE; - g_error("Timeout with no connection."); + g_debug("Timeout with no connection."); g_main_loop_quit(mainloop); return FALSE; } @@ -27,6 +27,7 @@ int main (int argc, char ** argv) { g_type_init(); + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); IndicatorServiceManager * is = indicator_service_manager_new("my.test.name"); g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL); -- cgit v1.2.3 From 9a15eec1f5fc9609b877a411564abbf600a22ee5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 11:17:10 -0600 Subject: Adding in the basic data needed to start bringing up a test to start the service. --- tests/Makefile.am | 41 +++++++++++++++++++++++++++- tests/service-manager-connect-service.c | 46 ++++++++++++++++++++++++++++++++ tests/service-manager-connect.c | 47 +++++++++++++++++++++++++++++++++ tests/session.conf.in | 40 ++++++++++++++++++++++++++++ 4 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 tests/service-manager-connect-service.c create mode 100644 tests/service-manager-connect.c create mode 100644 tests/session.conf.in (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index dd047d3..744c807 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,6 +4,8 @@ DISTCLEANFILES = check_PROGRAMS = \ test-loader \ service-manager-no-connect \ + service-manager-connect \ + service-manager-connect-service \ service-shutdown-timeout lib_LTLIBRARIES = \ @@ -120,7 +122,7 @@ service_manager_no_connect_LDADD = \ $(LIBINDICATOR_LIBS) \ $(top_builddir)/libindicator/.libs/libindicator.a -service-manager-no-connect-tester: service-manager-no-connect Makefile +service-manager-no-connect-tester: service-manager-no-connect Makefile.am @echo "#!/bin/sh" > service-manager-no-connect-tester @echo $(DBUS_RUNNER) --task ./service-manager-no-connect >> service-manager-no-connect-tester @chmod +x service-manager-no-connect-tester @@ -128,6 +130,43 @@ service-manager-no-connect-tester: service-manager-no-connect Makefile TESTS += service-manager-no-connect-tester DISTCLEANFILES += service-manager-no-connect-tester +############################# +# Service Manager Connect +############################# + +session.conf: session.conf.in Makefile.am + sed -e "s|\@servicedir\@|$(abspath $(builddir))|" $< > $@ + +service_manager_connect_SOURCES = \ + service-manager-connect.c + +service_manager_connect_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +service_manager_connect_LDADD = \ + $(LIBINDICATOR_LIBS) \ + $(top_builddir)/libindicator/.libs/libindicator.a + +service_manager_connect_service_SOURCES = \ + service-manager-connect-service.c + +service_manager_connect_service_CFLAGS = \ + -Wall -Werror \ + $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) + +service_manager_connect_service_LDADD = \ + $(LIBINDICATOR_LIBS) \ + $(top_builddir)/libindicator/.libs/libindicator.a + +service-manager-connect-tester: service-manager-connect service-manager-connect-service session.conf Makefile.am + @echo "#!/bin/sh" > service-manager-connect-tester + @echo dbus-test-runner --dbus-config $(builddir)/session.conf --task ./service-manager-connect >> service-manager-connect-tester + @chmod +x service-manager-connect-tester + +TESTS += service-manager-connect-tester +DISTCLEANFILES += service-manager-connect-tester + ############################# # Test stuff ############################# diff --git a/tests/service-manager-connect-service.c b/tests/service-manager-connect-service.c new file mode 100644 index 0000000..666739a --- /dev/null +++ b/tests/service-manager-connect-service.c @@ -0,0 +1,46 @@ + +#include +#include "libindicator/indicator-service.h" + +static GMainLoop * mainloop = NULL; +static gboolean passed = FALSE; + +gboolean +timeout (gpointer data) +{ + passed = FALSE; + g_error("Timeout with no shutdown."); + g_main_loop_quit(mainloop); + return FALSE; +} + +void +shutdown (void) +{ + g_debug("Shutdown"); + passed = TRUE; + g_main_loop_quit(mainloop); + return; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicatorService * is = indicator_service_new("my.test.name"); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL); + + g_timeout_add_seconds(1, timeout, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + if (passed) { + g_debug("Passed"); + return 0; + } + g_debug("Failed"); + return 1; +} diff --git a/tests/service-manager-connect.c b/tests/service-manager-connect.c new file mode 100644 index 0000000..1c32eb2 --- /dev/null +++ b/tests/service-manager-connect.c @@ -0,0 +1,47 @@ + +#include +#include "libindicator/indicator-service-manager.h" + +static GMainLoop * mainloop = NULL; +static gboolean passed = FALSE; + +gboolean +timeout (gpointer data) +{ + passed = TRUE; + g_debug("Timeout with no connection."); + g_main_loop_quit(mainloop); + return FALSE; +} + +void +connection (void) +{ + g_debug("Connection"); + passed = FALSE; + g_main_loop_quit(mainloop); + return; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); + + IndicatorServiceManager * is = indicator_service_manager_new("my.test.name"); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL); + + g_timeout_add_seconds(1, timeout, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + if (passed) { + g_debug("Passed"); + return 0; + } + g_debug("Failed"); + return 1; +} diff --git a/tests/session.conf.in b/tests/session.conf.in new file mode 100644 index 0000000..d1e2805 --- /dev/null +++ b/tests/session.conf.in @@ -0,0 +1,40 @@ + + + + + + unix:tmpdir=/tmp + + @servicedir@ + + + + + + + + + + + + 60000 + + + 1000000000 + 1000000000 + 1000000000 + 120000 + 240000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000 + 300000 + + -- cgit v1.2.3 From dc5fbef86dc82fbc1d768dba489fe4ba0b09adfc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 11:21:20 -0600 Subject: Building a service file. --- tests/Makefile.am | 5 ++++- tests/service-manager-connect.service.in | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/service-manager-connect.service.in (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 744c807..3703259 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -137,6 +137,9 @@ DISTCLEANFILES += service-manager-no-connect-tester session.conf: session.conf.in Makefile.am sed -e "s|\@servicedir\@|$(abspath $(builddir))|" $< > $@ +service-manager-connect.service: service-manager-connect.service.in Makefile.am + sed -e "s|\@builddir\@|$(abspath $(builddir))|" $< > $@ + service_manager_connect_SOURCES = \ service-manager-connect.c @@ -159,7 +162,7 @@ service_manager_connect_service_LDADD = \ $(LIBINDICATOR_LIBS) \ $(top_builddir)/libindicator/.libs/libindicator.a -service-manager-connect-tester: service-manager-connect service-manager-connect-service session.conf Makefile.am +service-manager-connect-tester: service-manager-connect service-manager-connect-service session.conf service-manager-connect.service Makefile.am @echo "#!/bin/sh" > service-manager-connect-tester @echo dbus-test-runner --dbus-config $(builddir)/session.conf --task ./service-manager-connect >> service-manager-connect-tester @chmod +x service-manager-connect-tester diff --git a/tests/service-manager-connect.service.in b/tests/service-manager-connect.service.in new file mode 100644 index 0000000..7d3da6b --- /dev/null +++ b/tests/service-manager-connect.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.ayatana.test +Exec=@builddir@/service-manager-connect-service -- cgit v1.2.3 From 5e5f49521da190319a54ee5a7d18f9b824823027 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 11:24:03 -0600 Subject: Switching the name to match the service file... should fail. --- tests/service-manager-connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/service-manager-connect.c b/tests/service-manager-connect.c index 1c32eb2..c7c9282 100644 --- a/tests/service-manager-connect.c +++ b/tests/service-manager-connect.c @@ -29,7 +29,7 @@ main (int argc, char ** argv) g_type_init(); g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); - IndicatorServiceManager * is = indicator_service_manager_new("my.test.name"); + IndicatorServiceManager * is = indicator_service_manager_new("org.ayatana.test"); g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL); g_timeout_add_seconds(1, timeout, NULL); -- cgit v1.2.3 From 6cb18e9a371158977143c198d43e69c73895496d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 16:13:28 -0600 Subject: We want to not get the shutdown. Since we're testing that we get it without connection we can now assume that if we don't get it we should pass. --- tests/service-manager-connect-service.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/service-manager-connect-service.c b/tests/service-manager-connect-service.c index 666739a..297f3ba 100644 --- a/tests/service-manager-connect-service.c +++ b/tests/service-manager-connect-service.c @@ -8,8 +8,8 @@ static gboolean passed = FALSE; gboolean timeout (gpointer data) { - passed = FALSE; - g_error("Timeout with no shutdown."); + passed = TRUE; + g_debug("Timeout with no shutdown."); g_main_loop_quit(mainloop); return FALSE; } @@ -17,8 +17,8 @@ timeout (gpointer data) void shutdown (void) { - g_debug("Shutdown"); - passed = TRUE; + g_error("Shutdown"); + passed = FALSE; g_main_loop_quit(mainloop); return; } @@ -28,7 +28,7 @@ main (int argc, char ** argv) { g_type_init(); - IndicatorService * is = indicator_service_new("my.test.name"); + IndicatorService * is = indicator_service_new("org.ayatana.test"); g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL); g_timeout_add_seconds(1, timeout, NULL); -- cgit v1.2.3 From c3d30bd0cfd9f29072424f7a4c63bab7618d45fa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 16:14:53 -0600 Subject: We should pass the test if we get a connection, it means we activated. --- tests/service-manager-connect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/service-manager-connect.c b/tests/service-manager-connect.c index c7c9282..c252542 100644 --- a/tests/service-manager-connect.c +++ b/tests/service-manager-connect.c @@ -8,8 +8,8 @@ static gboolean passed = FALSE; gboolean timeout (gpointer data) { - passed = TRUE; - g_debug("Timeout with no connection."); + passed = FALSE; + g_error("Timeout with no connection."); g_main_loop_quit(mainloop); return FALSE; } @@ -18,7 +18,7 @@ void connection (void) { g_debug("Connection"); - passed = FALSE; + passed = TRUE; g_main_loop_quit(mainloop); return; } -- cgit v1.2.3 From 5ccc73bea6b75cc3a027f831bb60bfcf43714deb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 16:17:31 -0600 Subject: Distcheck fixes. Looking for the files in the right place and making sure we clean up after ourselves. --- tests/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 3703259..7c306bc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -134,10 +134,10 @@ DISTCLEANFILES += service-manager-no-connect-tester # Service Manager Connect ############################# -session.conf: session.conf.in Makefile.am +session.conf: $(srcdir)/session.conf.in Makefile.am sed -e "s|\@servicedir\@|$(abspath $(builddir))|" $< > $@ -service-manager-connect.service: service-manager-connect.service.in Makefile.am +service-manager-connect.service: $(srcdir)/service-manager-connect.service.in Makefile.am sed -e "s|\@builddir\@|$(abspath $(builddir))|" $< > $@ service_manager_connect_SOURCES = \ @@ -168,7 +168,7 @@ service-manager-connect-tester: service-manager-connect service-manager-connect- @chmod +x service-manager-connect-tester TESTS += service-manager-connect-tester -DISTCLEANFILES += service-manager-connect-tester +DISTCLEANFILES += service-manager-connect-tester session.conf service-manager-connect.service ############################# # Test stuff -- cgit v1.2.3