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 the Gnome Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.
25 /* NOTE to compile this test, GTK+ needs to be build without
26 * the _-prefix stripping.
34 { "<GtkCheckButton>", "GtkToggleButton", FALSE },
35 { "<GtkCheckButton>", "GtkCheckButton", TRUE },
36 { "<GtkCheckButton>", "GtkRadioButton", TRUE },
37 { "abc*.<GtkButton>.<GtkLabel>.*foo", "abcx.GtkToggleButton.GtkLabel.foo", TRUE },
38 { "*abc.<GtkButton>.foo*", "abc.GtkToggleButton.bar", FALSE },
39 { "*abc.<GtkButton>.foo*", "xabc.GtkToggleButton.fox", FALSE },
48 type = gtk_radio_button_get_type ();
49 type = gtk_label_get_type ();
53 main (int argc, char *argv[])
57 gtk_init (&argc, &argv);
60 for (i = 0; tests[i].test; i++)
66 list = _gtk_rc_parse_widget_class_path (tests[i].pattern);
67 path = g_strdup (tests[i].test);
68 rpath = g_utf8_strreverse (path, -1);
69 result = _gtk_rc_match_widget_class (list, strlen (path), path, rpath);
70 g_print ("%d. \"%s\" \"%s\", expected %d, got %d\n",
71 i, tests[i].pattern, tests[i].test, tests[i].match, result);
72 g_assert (result == tests[i].match);