~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to gio/tests/desktop-app-info.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  GAppInfo *info;
35
35
 
36
36
  error = NULL;
37
 
  info = g_app_info_create_from_commandline ("/usr/bin/true blah",
 
37
  info = g_app_info_create_from_commandline ("/bin/true blah",
38
38
                                             name,
39
39
                                             G_APP_INFO_CREATE_NONE,
40
40
                                             &error);
350
350
  g_object_unref (file);
351
351
}
352
352
 
 
353
static void
 
354
test_extra_getters (void)
 
355
{
 
356
  GDesktopAppInfo *appinfo;
 
357
  gchar *s;
 
358
  gboolean b;
 
359
 
 
360
  appinfo = g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop");
 
361
  g_assert (appinfo != NULL);
 
362
 
 
363
  g_assert (g_desktop_app_info_has_key (appinfo, "Terminal"));
 
364
  g_assert (!g_desktop_app_info_has_key (appinfo, "Bratwurst"));
 
365
 
 
366
  s = g_desktop_app_info_get_string (appinfo, "StartupWMClass");
 
367
  g_assert_cmpstr (s, ==, "appinfo-class");
 
368
  g_free (s);
 
369
 
 
370
  b = g_desktop_app_info_get_boolean (appinfo, "Terminal");
 
371
  g_assert (b);
 
372
 
 
373
  g_object_unref (appinfo);
 
374
}
 
375
 
353
376
int
354
377
main (int   argc,
355
378
      char *argv[])
356
379
{
357
380
  gint result;
358
381
 
359
 
  g_type_init ();
360
382
  g_test_init (&argc, &argv, NULL);
361
383
  
362
384
  basedir = g_get_current_dir ();
367
389
  g_test_add_func ("/desktop-app-info/default", test_default);
368
390
  g_test_add_func ("/desktop-app-info/fallback", test_fallback);
369
391
  g_test_add_func ("/desktop-app-info/lastused", test_last_used);
 
392
  g_test_add_func ("/desktop-app-info/extra-getters", test_extra_getters);
370
393
 
371
394
  result = g_test_run ();
372
395