[glib] Add a test for new GDesktopAppInfo getters
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add a test for new GDesktopAppInfo getters
- Date: Thu, 22 Nov 2012 02:20:15 +0000 (UTC)
commit ace7b0fd86430774fc5de2eaee8d6b1b15930c59
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Nov 21 16:15:14 2012 -0500
Add a test for new GDesktopAppInfo getters
gio/tests/desktop-app-info.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
index 1c2cc02..05dda7c 100644
--- a/gio/tests/desktop-app-info.c
+++ b/gio/tests/desktop-app-info.c
@@ -350,6 +350,29 @@ cleanup_subdirs (const char *base_dir)
g_object_unref (file);
}
+static void
+test_extra_getters (void)
+{
+ GDesktopAppInfo *appinfo;
+ gchar *s;
+ gboolean b;
+
+ appinfo = g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop");
+ g_assert (appinfo != NULL);
+
+ g_assert (g_desktop_app_info_has_key (appinfo, "Terminal"));
+ g_assert (!g_desktop_app_info_has_key (appinfo, "Bratwurst"));
+
+ s = g_desktop_app_info_get_string (appinfo, "StartupWMClass");
+ g_assert_cmpstr (s, ==, "appinfo-class");
+ g_free (s);
+
+ b = g_desktop_app_info_get_boolean (appinfo, "Terminal");
+ g_assert (b);
+
+ g_object_unref (appinfo);
+}
+
int
main (int argc,
char *argv[])
@@ -366,6 +389,7 @@ main (int argc,
g_test_add_func ("/desktop-app-info/default", test_default);
g_test_add_func ("/desktop-app-info/fallback", test_fallback);
g_test_add_func ("/desktop-app-info/lastused", test_last_used);
+ g_test_add_func ("/desktop-app-info/extra-getters", test_extra_getters);
result = g_test_run ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]