mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-23 23:59:16 +02:00
Expand GAppInfo tests
This commit is contained in:
parent
51e6edf08b
commit
26a1056bde
@ -248,8 +248,22 @@ test_environment (void)
|
|||||||
{
|
{
|
||||||
GAppLaunchContext *ctx;
|
GAppLaunchContext *ctx;
|
||||||
gchar **env;
|
gchar **env;
|
||||||
|
const gchar *path;
|
||||||
|
|
||||||
|
g_unsetenv ("FOO");
|
||||||
|
g_unsetenv ("BLA");
|
||||||
|
path = g_getenv ("PATH");
|
||||||
|
|
||||||
ctx = g_app_launch_context_new ();
|
ctx = g_app_launch_context_new ();
|
||||||
|
|
||||||
|
env = g_app_launch_context_get_environment (ctx);
|
||||||
|
|
||||||
|
g_assert (g_environ_getenv (env, "FOO") == NULL);
|
||||||
|
g_assert (g_environ_getenv (env, "BAR") == NULL);
|
||||||
|
g_assert_cmpstr (g_environ_getenv (env, "PATH"), ==, path);
|
||||||
|
|
||||||
|
g_strfreev (env);
|
||||||
|
|
||||||
g_app_launch_context_setenv (ctx, "FOO", "bar");
|
g_app_launch_context_setenv (ctx, "FOO", "bar");
|
||||||
g_app_launch_context_setenv (ctx, "BLA", "bla");
|
g_app_launch_context_setenv (ctx, "BLA", "bla");
|
||||||
|
|
||||||
@ -257,6 +271,7 @@ test_environment (void)
|
|||||||
|
|
||||||
g_assert_cmpstr (g_environ_getenv (env, "FOO"), ==, "bar");
|
g_assert_cmpstr (g_environ_getenv (env, "FOO"), ==, "bar");
|
||||||
g_assert_cmpstr (g_environ_getenv (env, "BLA"), ==, "bla");
|
g_assert_cmpstr (g_environ_getenv (env, "BLA"), ==, "bla");
|
||||||
|
g_assert_cmpstr (g_environ_getenv (env, "PATH"), ==, path);
|
||||||
|
|
||||||
g_strfreev (env);
|
g_strfreev (env);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user