1 /* GTK - The GIMP Toolkit
3 Copyright (C) 2006 Red Hat, Inc.
4 Author: Matthias Clasen <mclasen@redhat.com>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
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 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
23 /* NOTE to compile this test, GTK+ needs to be build without
24 * the _-prefix stripping.
32 { "<GtkCheckButton>", "GtkToggleButton", FALSE },
33 { "<GtkCheckButton>", "GtkCheckButton", TRUE },
34 { "<GtkCheckButton>", "GtkRadioButton", TRUE },
35 { "abc*.<GtkButton>.<GtkLabel>.*foo", "abcx.GtkToggleButton.GtkLabel.foo", TRUE },
36 { "*abc.<GtkButton>.foo*", "abc.GtkToggleButton.bar", FALSE },
37 { "*abc.<GtkButton>.foo*", "xabc.GtkToggleButton.fox", FALSE },
46 type = gtk_radio_button_get_type ();
47 type = gtk_label_get_type ();
51 main (int argc, char *argv[])
55 gtk_init (&argc, &argv);
58 for (i = 0; tests[i].test; i++)
64 list = _gtk_rc_parse_widget_class_path (tests[i].pattern);
65 path = g_strdup (tests[i].test);
66 rpath = g_utf8_strreverse (path, -1);
67 result = _gtk_rc_match_widget_class (list, strlen (path), path, rpath);
68 g_print ("%d. \"%s\" \"%s\", expected %d, got %d\n",
69 i, tests[i].pattern, tests[i].test, tests[i].match, result);
70 g_assert (result == tests[i].match);