1 | /* Regression tests |
2 | * |
3 | * Copyright (C) 2011, Red Hat, Inc. |
4 | * Authors: Benjamin Otte <otte@gnome.org> |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Lesser General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Lesser General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #include <gtk/gtk.h> |
21 | |
22 | static void |
23 | test_9d6da33ff5c5e41e3521e1afd63d2d67bc915753 (void) |
24 | { |
25 | GtkWidget *window, *label; |
26 | |
27 | window = gtk_window_new (); |
28 | label = gtk_label_new (str: "I am sensitive." ); |
29 | gtk_window_set_child (GTK_WINDOW (window), child: label); |
30 | |
31 | gtk_widget_set_sensitive (widget: label, FALSE); |
32 | gtk_widget_set_sensitive (widget: window, FALSE); |
33 | gtk_widget_set_sensitive (widget: label, TRUE); |
34 | gtk_widget_set_sensitive (widget: window, TRUE); |
35 | |
36 | g_assert_true (gtk_widget_get_sensitive (label)); |
37 | |
38 | gtk_window_destroy (GTK_WINDOW (window)); |
39 | } |
40 | |
41 | static void |
42 | test_94f00eb04dd1433cf1cc9a3341f485124e38abd1 (void) |
43 | { |
44 | GtkWidget *window, *label; |
45 | |
46 | window = gtk_window_new (); |
47 | label = gtk_label_new (str: "I am insensitive." ); |
48 | gtk_window_set_child (GTK_WINDOW (window), child: label); |
49 | |
50 | gtk_widget_set_sensitive (widget: window, FALSE); |
51 | gtk_widget_set_sensitive (widget: label, FALSE); |
52 | gtk_widget_set_sensitive (widget: label, TRUE); |
53 | |
54 | g_assert_false (gtk_widget_is_sensitive (label)); |
55 | |
56 | gtk_window_destroy (GTK_WINDOW (window)); |
57 | } |
58 | |
59 | int |
60 | main (int argc, char *argv[]) |
61 | { |
62 | gtk_test_init (argcp: &argc, argvp: &argv, NULL); |
63 | |
64 | g_test_add_func (testpath: "/regression/94f00eb04dd1433cf1cc9a3341f485124e38abd1" , test_func: test_94f00eb04dd1433cf1cc9a3341f485124e38abd1); |
65 | g_test_add_func (testpath: "/regression/9d6da33ff5c5e41e3521e1afd63d2d67bc915753" , test_func: test_9d6da33ff5c5e41e3521e1afd63d2d67bc915753); |
66 | |
67 | return g_test_run (); |
68 | } |
69 | |