"Fossies" - the Fresh Open Source Software Archive

Member "glib-2.66.8/gio/tests/appinfo-test.c" (18 Mar 2021, 626 Bytes) of package /linux/misc/glib-2.66.8.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <stdlib.h>
    2 #include <gio/gio.h>
    3 
    4 int
    5 main (int argc, char *argv[])
    6 {
    7   const gchar *envvar;
    8 
    9   g_test_init (&argc, &argv, NULL);
   10 
   11   envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE");
   12   if (envvar != NULL)
   13     {
   14       gchar *expected;
   15       gint pid_from_env;
   16 
   17       expected = g_test_build_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
   18       g_assert_cmpstr (envvar, ==, expected);
   19       g_free (expected);
   20 
   21       envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID");
   22       g_assert (envvar != NULL);
   23       pid_from_env = atoi (envvar);
   24       g_assert_cmpint (pid_from_env, ==, getpid ());
   25     }
   26 
   27   return 0;
   28 }