[glib] Add some GAppLaunchContext tests



commit 74fbd3296d259b04e4fe17e4ebd358827ae07e1f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 4 23:41:40 2010 -0400

    Add some GAppLaunchContext tests

 gio/tests/appinfo.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/appinfo.c b/gio/tests/appinfo.c
index 3c89eba..be63a92 100644
--- a/gio/tests/appinfo.c
+++ b/gio/tests/appinfo.c
@@ -137,18 +137,42 @@ test_commandline (void)
   g_object_unref (appinfo);
 }
 
+static void
+test_launch_context (void)
+{
+  GAppLaunchContext *context;
+  GAppInfo *appinfo;
+  gchar *str;
+
+  context = g_app_launch_context_new ();
+  appinfo = g_app_info_create_from_commandline ("./appinfo-test --option",
+                                                "cmdline-app-test",
+                                                G_APP_INFO_CREATE_SUPPORTS_URIS,
+                                                NULL);
+
+  str = g_app_launch_context_get_display (context, appinfo, NULL);
+  g_assert (str == NULL);
+
+  str = g_app_launch_context_get_startup_notify_id (context, appinfo, NULL);
+  g_assert (str == NULL);
+
+  g_object_unref (appinfo);
+  g_object_unref (context);
+}
+
 int
 main (int argc, char *argv[])
 {
   g_type_init ();
   g_test_init (&argc, &argv, NULL);
 
+
   g_test_add_func ("/appinfo/basic", test_basic);
   g_test_add_func ("/appinfo/text", test_text);
   g_test_add_func ("/appinfo/launch", test_launch);
   g_test_add_func ("/appinfo/show-in", test_show_in);
   g_test_add_func ("/appinfo/commandline", test_commandline);
-
+  g_test_add_func ("/appinfo/launch-context", test_launch_context);
   return g_test_run ();
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]