diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-20 07:15:46 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-20 08:19:23 -0500 |
commit | a9753ef5c65ad4d3217bed05b112f4bc4f71bb89 (patch) | |
tree | bb100938332bb0cce9354c52a34e427ce2c59858 /gtk/tests | |
parent | 7030492a3b57191c3e1ae7728bb69999e8c9a555 (diff) | |
download | gtk+-a9753ef5c65ad4d3217bed05b112f4bc4f71bb89.tar.gz |
Add a test for basic style properties
Diffstat (limited to 'gtk/tests')
-rw-r--r-- | gtk/tests/stylecontext.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk/tests/stylecontext.c b/gtk/tests/stylecontext.c index b1e413f197..5250919819 100644 --- a/gtk/tests/stylecontext.c +++ b/gtk/tests/stylecontext.c @@ -518,6 +518,36 @@ test_style_property (void) g_object_unref (context); } +void +test_basic_properties (void) +{ + GtkStyleContext *context; + GtkWidgetPath *path; + GdkRGBA *color; + GdkRGBA *bg_color; + PangoFontDescription *font; + + context = gtk_style_context_new (); + path = gtk_widget_path_new (); + gtk_style_context_set_path (context, path); + gtk_widget_path_free (path); + + gtk_style_context_get (context, 0, + "color", &color, + "background-color", &bg_color, + "font", &font, + NULL); + g_assert (color != NULL); + g_assert (bg_color != NULL); + g_assert (font != NULL); + + gdk_rgba_free (color); + gdk_rgba_free (bg_color); + pango_font_description_free (font); + + g_object_unref (context); +} + int main (int argc, char *argv[]) { @@ -531,6 +561,7 @@ main (int argc, char *argv[]) g_test_add_func ("/style/path", test_path); g_test_add_func ("/style/match", test_match); g_test_add_func ("/style/style-property", test_style_property); + g_test_add_func ("/style/basic", test_basic_properties); return g_test_run (); } |