[glib] Expand GAppInfo tests
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Expand GAppInfo tests
- Date: Mon, 4 Jun 2012 10:03:38 +0000 (UTC)
commit 26a1056bde7f6ef97963b1a4b42d3da3027f555f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jun 3 16:30:58 2012 -0400
Expand GAppInfo tests
gio/tests/appinfo.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/appinfo.c b/gio/tests/appinfo.c
index e8e511a..939e34b 100644
--- a/gio/tests/appinfo.c
+++ b/gio/tests/appinfo.c
@@ -248,8 +248,22 @@ test_environment (void)
{
GAppLaunchContext *ctx;
gchar **env;
+ const gchar *path;
+
+ g_unsetenv ("FOO");
+ g_unsetenv ("BLA");
+ path = g_getenv ("PATH");
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, "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, "BLA"), ==, "bla");
+ g_assert_cmpstr (g_environ_getenv (env, "PATH"), ==, path);
g_strfreev (env);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]