| 1 |
/* Regression tests |
| 2 |
* |
| 3 |
* Copyright (C) 2011, Red Hat, Inc. |
| 4 |
* Authors: Benjamin Otte <[email protected]> |
| 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 (GTK_WINDOW_POPUP); |
| 28 |
label = gtk_label_new ("I am sensitive."); |
| 29 |
gtk_container_add (GTK_CONTAINER (window), label); |
| 30 |
|
| 31 |
gtk_widget_set_sensitive (label, FALSE); |
| 32 |
gtk_widget_set_sensitive (window, FALSE); |
| 33 |
gtk_widget_set_sensitive (label, TRUE); |
| 34 |
gtk_widget_set_sensitive (window, TRUE); |
| 35 |
|
| 36 |
g_assert (gtk_widget_get_sensitive (label)); |
| 37 |
|
| 38 |
gtk_widget_destroy (window); |
| 39 |
} |
| 40 |
|
| 41 |
static void |
| 42 |
test_94f00eb04dd1433cf1cc9a3341f485124e38abd1 (void) |
| 43 |
{ |
| 44 |
GtkWidget *window, *label; |
| 45 |
|
| 46 |
window = gtk_window_new (GTK_WINDOW_POPUP); |
| 47 |
label = gtk_label_new ("I am insensitive."); |
| 48 |
gtk_container_add (GTK_CONTAINER (window), label); |
| 49 |
|
| 50 |
gtk_widget_set_sensitive (window, FALSE); |
| 51 |
gtk_widget_set_sensitive (label, FALSE); |
| 52 |
gtk_widget_set_sensitive (label, TRUE); |
| 53 |
|
| 54 |
g_assert (!gtk_widget_is_sensitive (label)); |
| 55 |
|
| 56 |
gtk_widget_destroy (window); |
| 57 |
} |
| 58 |
|
| 59 |
int |
| 60 |
main (int argc, char *argv[]) |
| 61 |
{ |
| 62 |
gtk_test_init (&argc, &argv, NULL); |
| 63 |
|
| 64 |
g_test_add_func ("/regression/94f00eb04dd1433cf1cc9a3341f485124e38abd1", test_94f00eb04dd1433cf1cc9a3341f485124e38abd1); |
| 65 |
g_test_add_func ("/regression/9d6da33ff5c5e41e3521e1afd63d2d67bc915753", test_9d6da33ff5c5e41e3521e1afd63d2d67bc915753); |
| 66 |
|
| 67 |
return g_test_run (); |
| 68 |
} |