diff options
author | Ted Gould <ted@canonical.com> | 2009-01-21 16:10:21 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-01-21 16:10:21 -0600 |
commit | 0fc106dd6a5081d3769668249556766e15c07c71 (patch) | |
tree | e1e6c9683d358025958aeb1acd3bd4b611aeae6e | |
parent | 48697b95718bbfb3100cff9721baa26d6c504552 (diff) | |
download | libayatana-indicator-0fc106dd6a5081d3769668249556766e15c07c71.tar.gz libayatana-indicator-0fc106dd6a5081d3769668249556766e15c07c71.tar.bz2 libayatana-indicator-0fc106dd6a5081d3769668249556766e15c07c71.zip |
Adding in the im-client test and fixing a couple of bugs it found
-rw-r--r-- | libindicate/indicator-message.c | 6 | ||||
-rw-r--r-- | libindicate/indicator-message.h | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 15 | ||||
-rw-r--r-- | tests/im-client.c | 21 |
4 files changed, 43 insertions, 2 deletions
diff --git a/libindicate/indicator-message.c b/libindicate/indicator-message.c index 3df7b4e..32cf000 100644 --- a/libindicate/indicator-message.c +++ b/libindicate/indicator-message.c @@ -60,3 +60,9 @@ get_indicator_type (IndicateIndicator * indicator) { return "message"; } + +IndicateIndicatorMessage * +indicate_indicator_message_new (void) +{ + return g_object_new(INDICATE_TYPE_INDICATOR_MESSAGE, NULL); +} diff --git a/libindicate/indicator-message.h b/libindicate/indicator-message.h index fb0c30d..ade584e 100644 --- a/libindicate/indicator-message.h +++ b/libindicate/indicator-message.h @@ -8,7 +8,7 @@ G_BEGIN_DECLS -#define INDICATE_TYPE_INDICATOR_MESSAGE (indicator_message_get_type ()) +#define INDICATE_TYPE_INDICATOR_MESSAGE (indicate_indicator_message_get_type ()) #define INDICATE_INDICATOR_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATE_TYPE_INDICATOR_MESSAGE, IndicateIndicatorMessage)) #define INDICATE_INDICATOR_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATE_TYPE_INDICATOR_MESSAGE, IndicateIndicatorMessageClass)) #define INDICATE_IS_INDICATOR_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATE_TYPE_INDICATOR_MESSAGE)) @@ -29,6 +29,7 @@ IndicateIndicator parent; }; GType indicate_indicator_message_get_type (void); +IndicateIndicatorMessage * indicate_indicator_message_new (void); G_END_DECLS diff --git a/tests/Makefile.am b/tests/Makefile.am index 03ec716..0017bca 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,8 @@ noinst_PROGRAMS = \ indicate-and-crash \ indicate-alot \ - listen-and-print + listen-and-print \ + im-client indicate_and_crash_SOURCES = \ indicate-and-crash.c @@ -36,3 +37,15 @@ listen_and_print_CFLAGS = \ listen_and_print_LDADD = \ ../libindicate/libindicate.la \ $(LIBINDICATE_LIBS) + +im_client_SOURCES = \ + im-client.c + +im_client_CFLAGS = \ + -I $(srcdir)/.. \ + $(LIBINDICATE_CFLAGS) + +im_client_LDADD = \ + ../libindicate/libindicate.la \ + $(LIBINDICATE_LIBS) + diff --git a/tests/im-client.c b/tests/im-client.c new file mode 100644 index 0000000..cdf3484 --- /dev/null +++ b/tests/im-client.c @@ -0,0 +1,21 @@ + +#include <glib.h> +#include "libindicate/indicator-message.h" + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicateIndicatorMessage * indicator; + + indicator = indicate_indicator_message_new(); + indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "subtype", "im"); + indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "sender", "Ted Gould"); + indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "time", "11:11"); + indicate_indicator_show(indicator); + + g_main_loop_run(g_main_loop_new(NULL, FALSE)); + + return 0; +} |