[Galago-commits] r2535 - in trunk/libnotify: . tests
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sat Feb 4 01:47:23 PST 2006
Author: chipx86
Date: 2006-02-04 01:47:18 -0800 (Sat, 04 Feb 2006)
New Revision: 2535
Added:
trunk/libnotify/tests/test-urgency.c
Modified:
trunk/libnotify/ChangeLog
trunk/libnotify/tests/Makefile.am
trunk/libnotify/tests/test-image.c
Log:
Add a test-urgency testcase.
Modified: trunk/libnotify/ChangeLog
===================================================================
--- trunk/libnotify/ChangeLog 2006-02-04 09:27:13 UTC (rev 2534)
+++ trunk/libnotify/ChangeLog 2006-02-04 09:47:18 UTC (rev 2535)
@@ -1,3 +1,9 @@
+Sat Feb 04 01:47:00 PST 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ A tests/test-urgency.c:
+ * tests/Makefile.am:
+ - Add a test-urgency testcase.
+
Sun Jan 29 13:26:31 PST 2006 Christian Hammond <chipx86 at chipx86.com>
* Doxyfile.in:
Modified: trunk/libnotify/tests/Makefile.am
===================================================================
--- trunk/libnotify/tests/Makefile.am 2006-02-04 09:27:13 UTC (rev 2534)
+++ trunk/libnotify/tests/Makefile.am 2006-02-04 09:47:18 UTC (rev 2535)
@@ -1,12 +1,3 @@
-if HAVE_GDK
-gdk_tests = \
- test-xy-stress
-
-test_xy_stress_SOURCES = test-xy-stress.c
-else
-gdk_tests =
-endif
-
noinst_PROGRAMS = \
test-replace \
test-replace-widget \
@@ -17,8 +8,9 @@
test-basic \
test-error \
test-markup \
+ test-urgency \
test-xy \
- $(gdk_tests)
+ test-xy-stress
common_ldflags = \
$(top_builddir)/libnotify/libnotify.la \
@@ -52,9 +44,13 @@
test_markup_SOURCES = test-markup.c
test_markup_LDADD = $(common_ldflags)
+test_urgency_SOURCES = test-urgency.c
+test_urgency_LDADD = $(common_ldflags)
+
test_xy_SOURCES = test-xy.c
test_xy_LDADD = $(common_ldflags)
+test_xy_stress_SOURCES = test-xy-stress.c
test_xy_stress_LDADD = $(common_ldflags)
INCLUDES = $(PACKAGE_CFLAGS) \
Modified: trunk/libnotify/tests/test-image.c
===================================================================
--- trunk/libnotify/tests/test-image.c 2006-02-04 09:27:13 UTC (rev 2534)
+++ trunk/libnotify/tests/test-image.c 2006-02-04 09:47:18 UTC (rev 2535)
@@ -58,7 +58,7 @@
/* Stock icon */
n = notify_notification_new("Icon Test", "Testing stock icon",
- "stock_help", NULL);
+ "stock_samples", NULL);
if (!notify_notification_show(n, NULL))
{
Added: trunk/libnotify/tests/test-urgency.c
===================================================================
--- trunk/libnotify/tests/test-urgency.c 2006-02-04 09:27:13 UTC (rev 2534)
+++ trunk/libnotify/tests/test-urgency.c 2006-02-04 09:47:18 UTC (rev 2535)
@@ -0,0 +1,70 @@
+/*
+ * @file tests/test-urgency.c Unit test: urgency levels
+ *
+ * @Copyright(C) 2006 Christian Hammond <chipx8 at chipx86.com>
+ *
+ * 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 <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ NotifyNotification *n;
+
+ notify_init("Urgency");
+
+ n = notify_notification_new("Low Urgency", "Joe signed online.",
+ NULL, NULL);
+ if (!notify_notification_show(n, NULL))
+ {
+ fprintf(stderr, "failed to send notification\n");
+ exit(1);
+ }
+
+ g_object_unref(G_OBJECT(n));
+
+
+ n = notify_notification_new("Normal Urgency",
+ "You have a meeting in 10 minutes.",
+ NULL, NULL);
+ if (!notify_notification_show(n, NULL))
+ {
+ fprintf(stderr, "failed to send notification\n");
+ exit(1);
+ }
+
+ g_object_unref(G_OBJECT(n));
+
+
+ n = notify_notification_new("Critical Urgency",
+ "This message will self-destruct in 10 "
+ "seconds.",
+ NULL, NULL);
+ notify_notification_set_timeout(n, 10000); // 10 seconds
+
+ if (!notify_notification_show(n, NULL))
+ {
+ fprintf(stderr, "failed to send notification\n");
+ exit(1);
+ }
+
+ g_object_unref(G_OBJECT(n));
+
+ return 0;
+}
More information about the galago-commits
mailing list