File: appinfo-test.c

package info (click to toggle)
glib2.0 2.86.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 73,060 kB
  • sloc: ansic: 544,382; python: 9,702; sh: 1,612; xml: 1,482; perl: 1,222; cpp: 535; makefile: 321; javascript: 11
file content (28 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdlib.h>
#include <gio/gio.h>

int
main (int argc, char *argv[])
{
  const gchar *envvar;

  g_test_init (&argc, &argv, NULL);

  envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE");
  if (envvar != NULL)
    {
      gchar *expected;
      gint pid_from_env;

      expected = g_test_build_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
      g_assert_cmpstr (envvar, ==, expected);
      g_free (expected);

      envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID");
      g_assert (envvar != NULL);
      pid_from_env = atoi (envvar);
      g_assert_cmpint (pid_from_env, ==, getpid ());
    }

  return 0;
}