summaryrefslogtreecommitdiff
path: root/tests/test-basic.c
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2005-11-10 19:18:10 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2005-11-10 19:18:10 +0000
commit6017d6af7b309f6b654109ed8c0e88f7c6d58ae3 (patch)
tree67738265c9046e1d1b7e51a41dc45363b719c657 /tests/test-basic.c
downloadlibnotify-6017d6af7b309f6b654109ed8c0e88f7c6d58ae3.tar.gz
First import of the next generation libnotify API
Diffstat (limited to 'tests/test-basic.c')
-rw-r--r--tests/test-basic.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/test-basic.c b/tests/test-basic.c
new file mode 100644
index 0000000..e04a5fa
--- /dev/null
+++ b/tests/test-basic.c
@@ -0,0 +1,42 @@
+/*
+ * @file tests/test-basic.c Unit test: basics
+ *
+ * @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 <unistd.h>
+
+int main() {
+ NotifyNotification *n;
+
+ notify_init("Basics");
+
+ n = notify_notification_new ("Summary",
+ "Content",
+ NULL, NULL);
+ notify_notification_set_timeout (n, 3000); //3 seconds
+
+ if (!notify_notification_show (n, NULL)) {
+ fprintf(stderr, "failed to send notification\n");
+ return 1;
+ }
+
+ return 0;
+}