From 1c6070a6792b78f44df9746ee96116cbbcc4dd40 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 23 Jun 2012 17:51:11 -0400 Subject: [PATCH] Add a test for G_USER_DIRECTOR_DESKTOP Based on a patch by Marc-Antoine Perennou, https://bugzilla.gnome.org/show_bug.cgi?id=676594 --- glib/tests/utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/glib/tests/utils.c b/glib/tests/utils.c index daa3dc8e0..4b1533a4c 100644 --- a/glib/tests/utils.c +++ b/glib/tests/utils.c @@ -430,6 +430,19 @@ test_special_dir (void) g_assert_cmpstr (dir, ==, dir2); } +static void +test_desktop_special_dir (void) +{ + const gchar *dir, *dir2; + + dir = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP); + g_assert (dir != NULL); + + g_reload_user_special_dirs_cache (); + dir2 = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP); + g_assert (dir2 != NULL); +} + static void test_clear_pointer (void) { @@ -492,6 +505,7 @@ main (int argc, g_test_add_func ("/utils/hostname", test_hostname); g_test_add_func ("/utils/xdgdirs", test_xdg_dirs); g_test_add_func ("/utils/specialdir", test_special_dir); + g_test_add_func ("/utils/specialdir/desktop", test_desktop_special_dir); g_test_add_func ("/utils/clear-pointer", test_clear_pointer); g_test_add_func ("/utils/misc-mem", test_misc_mem);