summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-03-10 19:28:34 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-03-10 19:28:34 +0000
commit980fdb08d9ecc4bb620d733674df4b54ed536b37 (patch)
tree83bc88e9042e273b146642d55ccccae7edb49eab /tests
parent26c98dfaca3f6969c855eceef512ff3edf6ec2ef (diff)
downloadgdk-pixbuf-980fdb08d9ecc4bb620d733674df4b54ed536b37.tar.gz
Add the possibility to test what happens if the process just calls exit()
2008-03-10 Tor Lillqvist <tml@novell.com> * tests/teststatusicon.c (do_exit, popup_menu): Add the possibility to test what happens if the process just calls exit() without any orderly cleanup of GTK+. svn path=/trunk/; revision=19745
Diffstat (limited to 'tests')
-rwxr-xr-xtests/teststatusicon.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/teststatusicon.c b/tests/teststatusicon.c
index 9fe9c99c5..86473601f 100755
--- a/tests/teststatusicon.c
+++ b/tests/teststatusicon.c
@@ -22,6 +22,8 @@
*/
#include <gtk/gtk.h>
+#include <stdlib.h>
+
#include "prop-editor.h"
typedef enum
@@ -256,6 +258,12 @@ do_quit (GtkMenuItem *item)
gtk_main_quit ();
}
+static void
+do_exit (GtkMenuItem *item)
+{
+ exit (0);
+}
+
static void
popup_menu (GtkStatusIcon *icon,
guint button,
@@ -291,6 +299,13 @@ popup_menu (GtkStatusIcon *icon,
gtk_widget_show (menuitem);
+ menuitem = gtk_menu_item_new_with_label ("Exit abruptly");
+ g_signal_connect (menuitem, "activate", G_CALLBACK (do_exit), NULL);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+ gtk_widget_show (menuitem);
+
gtk_menu_popup (GTK_MENU (menu),
NULL, NULL,
gtk_status_icon_position_menu, icon,