diff options
author | Christian Hammond <chipx86@chipx86.com> | 2006-01-16 01:53:06 +0000 |
---|---|---|
committer | Christian Hammond <chipx86@chipx86.com> | 2006-01-16 01:53:06 +0000 |
commit | 85981b247c52738b6144aa5556afc9f8eb2d7388 (patch) | |
tree | fe50a58afe4a5b9c4f95830cf33d6aefd0bee3c1 /tests | |
parent | 29b5c2b8ea8973ac8408b1030e683601ce3536a1 (diff) | |
download | libnotify-85981b247c52738b6144aa5556afc9f8eb2d7388.tar.gz |
Add back notify_get_server_info() and notify_get_server_caps().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 10 | ||||
-rw-r--r-- | tests/test-server-info.c | 60 | ||||
-rw-r--r-- | tests/test-xy.c | 2 |
3 files changed, 71 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 9f4195a..4b8b9a3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,6 +10,7 @@ endif noinst_PROGRAMS = \ test-replace \ test-replace-widget \ + test-server-info \ test-default-action \ test-multi-actions \ test-image \ @@ -26,16 +27,25 @@ common_ldflags = \ test_replace_SOURCES = test-replace.c test_replace_LDADD = $(common_ldflags) + test_replace_widget_SOURCES = test-replace-widget.c test_replace_widget_LDADD = $(common_ldflags) + +test_server_info_SOURCES = test-server-info.c +test_server_info_LDADD = $(common_ldflags) + test_default_action_SOURCES = test-default-action.c test_default_action_LDADD = $(common_ldflags) + test_multi_actions_SOURCES = test-multi-actions.c test_multi_actions_LDADD = $(common_ldflags) + test_image_SOURCES = test-image.c test_image_LDADD = $(common_ldflags) + test_basic_SOURCES = test-basic.c test_basic_LDADD = $(common_ldflags) + test_error_SOURCES = test-error.c test_error_LDADD = $(common_ldflags) diff --git a/tests/test-server-info.c b/tests/test-server-info.c new file mode 100644 index 0000000..643cf33 --- /dev/null +++ b/tests/test-server-info.c @@ -0,0 +1,60 @@ +/* + * @file tests/test-server-info.c Retrieves the server info and caps + * + * @Copyright (C) 2004 Mike Hearn <mike@navi.cx> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include <libnotify/notify.h> +#include <stdio.h> +#include <stdlib.h> + +int +main(int argc, char **argv) +{ + notify_init("TestCaps"); + GList *l, *caps; + char *name, *vendor, *version, *spec_version; + + if (!notify_get_server_info(&name, &vendor, &version, &spec_version)) + { + fprintf(stderr, "Failed to receive server info.\n"); + exit(1); + } + + printf("Name: %s\n", name); + printf("Vendor: %s\n", vendor); + printf("Version: %s\n", version); + printf("Spec Version: %s\n", spec_version); + printf("Capabilities:\n"); + + caps = notify_get_server_caps(); + + if (caps == NULL) + { + fprintf(stderr, "Failed to receive server caps.\n"); + exit(1); + } + + for (l = caps; l != NULL; l = l->next) + printf("\t%s\n", (char *)l->data); + + g_list_foreach(caps, (GFunc)g_free, NULL); + g_list_free(caps); + + return 0; +} diff --git a/tests/test-xy.c b/tests/test-xy.c index 612a04f..f9daf8e 100644 --- a/tests/test-xy.c +++ b/tests/test-xy.c @@ -32,7 +32,7 @@ int main() { "This notification should point to 150, 10", NULL, NULL); - notify_notification_set_hint_int32 (n, "x", 30); + notify_notification_set_hint_int32 (n, "x", 150); notify_notification_set_hint_int32 (n, "y", 10); if (!notify_notification_show (n, NULL)) { |