[Galago-commits] r2954 - in trunk/libnotify: . tests

galago-commits at freedesktop.org galago-commits at freedesktop.org
Mon Nov 13 23:42:39 PST 2006


Author: chipx86
Date: 2006-11-13 23:42:35 -0800 (Mon, 13 Nov 2006)
New Revision: 2954

Added:
   trunk/libnotify/tests/test-size-changes.c
Modified:
   trunk/libnotify/ChangeLog
   trunk/libnotify/tests/
   trunk/libnotify/tests/Makefile.am
   trunk/libnotify/tests/test-default-action.c
Log:
Added a test program that displays three notifications and then changes the amount of text in one of them.


Modified: trunk/libnotify/ChangeLog
===================================================================
--- trunk/libnotify/ChangeLog	2006-11-14 07:32:49 UTC (rev 2953)
+++ trunk/libnotify/ChangeLog	2006-11-14 07:42:35 UTC (rev 2954)
@@ -1,3 +1,11 @@
+Mon Nov 13 23:42:07 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* tests/Makefile.am:
+	A tests/test-size-changes.c:
+	* tests/test-default-action.c:
+	  - Added a test program that displays three notifications and then
+	    changes the amount of text in one of them.
+
 Sun Nov 05 12:06:01 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* libnotify/notify.c:


Property changes on: trunk/libnotify/tests
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
core*
test-animation
test-basic
test-default-action
test-error
test-image
test-markup
test-multi-actions
test-replace
test-replace-widget
test-server-info
test-urgency
test-xy
test-xy-actions
test-xy-stress
.deps
.libs
.*.swp

   + Makefile
Makefile.in
core*
test-animation
test-basic
test-default-action
test-error
test-image
test-markup
test-multi-actions
test-replace
test-replace-widget
test-server-info
test-size-changes
test-urgency
test-xy
test-xy-actions
test-xy-stress
.deps
.libs
.*.swp


Modified: trunk/libnotify/tests/Makefile.am
===================================================================
--- trunk/libnotify/tests/Makefile.am	2006-11-14 07:32:49 UTC (rev 2953)
+++ trunk/libnotify/tests/Makefile.am	2006-11-14 07:42:35 UTC (rev 2954)
@@ -8,6 +8,7 @@
 	test-basic \
 	test-error \
 	test-markup \
+	test-size-changes \
 	test-urgency \
 	test-xy \
 	test-xy-actions \
@@ -27,6 +28,9 @@
 test_server_info_SOURCES = test-server-info.c
 test_server_info_LDADD   = $(common_ldflags)
 
+test_size_changes_SOURCES = test-size-changes.c
+test_size_changes_LDADD   = $(common_ldflags)
+
 test_default_action_SOURCES = test-default-action.c
 test_default_action_LDADD  = $(common_ldflags)
 

Modified: trunk/libnotify/tests/test-default-action.c
===================================================================
--- trunk/libnotify/tests/test-default-action.c	2006-11-14 07:32:49 UTC (rev 2953)
+++ trunk/libnotify/tests/test-default-action.c	2006-11-14 07:42:35 UTC (rev 2954)
@@ -37,6 +37,7 @@
 
 static void callback(NotifyNotification *n, const char *action, void *user_data)
 {
+	printf("callback\n");
 	assert (action != NULL);
         assert (strcmp ("default", action) == 0);
 

Added: trunk/libnotify/tests/test-size-changes.c
===================================================================
--- trunk/libnotify/tests/test-size-changes.c	2006-11-14 07:32:49 UTC (rev 2953)
+++ trunk/libnotify/tests/test-size-changes.c	2006-11-14 07:42:35 UTC (rev 2954)
@@ -0,0 +1,84 @@
+/*
+ * @file tests/test-size-changes.c Unit test: Notification size changes
+ *
+ * @Copyright (C) 2006 Christian Hammond <chipx86 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 <stdio.h>
+#include <unistd.h>
+
+int
+main()
+{
+	NotifyNotification *n1, *n2, *n3;
+
+	notify_init("Size Changes");
+
+	n1 = notify_notification_new("Notification 1", "Notification number 1!",
+								 NULL, NULL);
+	notify_notification_set_timeout(n1, 7000);
+
+	if (!notify_notification_show(n1, NULL))
+	{
+		fprintf(stderr, "failed to send notification\n");
+		return 1;
+	}
+
+	g_object_unref(G_OBJECT(n1));
+
+	n2 = notify_notification_new("Notification 2", "Notification number 2!",
+								 NULL, NULL);
+	notify_notification_set_timeout(n2, 7000);
+
+	if (!notify_notification_show(n2, NULL))
+	{
+		fprintf(stderr, "failed to send notification\n");
+		return 1;
+	}
+
+
+	n3 = notify_notification_new("Notification 3", "Notification number 3!",
+								 NULL, NULL);
+	notify_notification_set_timeout(n3, 7000);
+
+	if (!notify_notification_show(n3, NULL))
+	{
+		fprintf(stderr, "failed to send notification\n");
+		return 1;
+	}
+
+	g_object_unref(G_OBJECT(n3));
+
+	sleep(2);
+
+	notify_notification_update(n2, "Longer Notification 2",
+							   "This is a much longer notification.\n"
+							   "Two lines.\n"
+							   "Well, okay, three.\n"
+							   "Last one.",
+							   NULL);
+
+	if (!notify_notification_show(n2, NULL))
+	{
+		fprintf(stderr, "failed to send notification\n");
+		return 1;
+	}
+
+	return 0;
+}



More information about the galago-commits mailing list