2010-06-07 19:25:39 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <gio/gio.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
const gchar *envvar;
|
|
|
|
|
2013-11-24 04:21:29 +01:00
|
|
|
g_test_init (&argc, &argv, NULL);
|
2010-06-07 19:25:39 +02:00
|
|
|
|
|
|
|
envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE");
|
2013-11-24 04:21:29 +01:00
|
|
|
if (envvar != NULL)
|
|
|
|
{
|
|
|
|
gchar *expected;
|
|
|
|
gint pid_from_env;
|
|
|
|
|
2018-11-30 18:20:48 +01:00
|
|
|
expected = g_test_build_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
2013-11-24 04:21:29 +01:00
|
|
|
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 ());
|
|
|
|
}
|
2010-06-07 19:25:39 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|