mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 05:21:55 -06:00
tests: fix test-qga leaks
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
59351d9b40
commit
1e2713384c
1 changed files with 5 additions and 0 deletions
|
@ -398,6 +398,7 @@ static void test_qga_file_ops(gconstpointer fix)
|
||||||
/* check content */
|
/* check content */
|
||||||
path = g_build_filename(fixture->test_dir, "foo", NULL);
|
path = g_build_filename(fixture->test_dir, "foo", NULL);
|
||||||
f = fopen(path, "r");
|
f = fopen(path, "r");
|
||||||
|
g_free(path);
|
||||||
g_assert_nonnull(f);
|
g_assert_nonnull(f);
|
||||||
count = fread(tmp, 1, sizeof(tmp), f);
|
count = fread(tmp, 1, sizeof(tmp), f);
|
||||||
g_assert_cmpint(count, ==, sizeof(helloworld));
|
g_assert_cmpint(count, ==, sizeof(helloworld));
|
||||||
|
@ -700,7 +701,9 @@ static void test_qga_config(gconstpointer data)
|
||||||
cwd = g_get_current_dir();
|
cwd = g_get_current_dir();
|
||||||
cmd = g_strdup_printf("%s%cqemu-ga -D",
|
cmd = g_strdup_printf("%s%cqemu-ga -D",
|
||||||
cwd, G_DIR_SEPARATOR);
|
cwd, G_DIR_SEPARATOR);
|
||||||
|
g_free(cwd);
|
||||||
g_shell_parse_argv(cmd, NULL, &argv, &error);
|
g_shell_parse_argv(cmd, NULL, &argv, &error);
|
||||||
|
g_free(cmd);
|
||||||
g_assert_no_error(error);
|
g_assert_no_error(error);
|
||||||
|
|
||||||
env[0] = g_strdup_printf("QGA_CONF=tests%cdata%ctest-qga-config",
|
env[0] = g_strdup_printf("QGA_CONF=tests%cdata%ctest-qga-config",
|
||||||
|
@ -708,6 +711,8 @@ static void test_qga_config(gconstpointer data)
|
||||||
env[1] = NULL;
|
env[1] = NULL;
|
||||||
g_spawn_sync(NULL, argv, env, 0,
|
g_spawn_sync(NULL, argv, env, 0,
|
||||||
NULL, NULL, &out, &err, &status, &error);
|
NULL, NULL, &out, &err, &status, &error);
|
||||||
|
g_strfreev(argv);
|
||||||
|
|
||||||
g_assert_no_error(error);
|
g_assert_no_error(error);
|
||||||
g_assert_cmpstr(err, ==, "");
|
g_assert_cmpstr(err, ==, "");
|
||||||
g_assert_cmpint(status, ==, 0);
|
g_assert_cmpint(status, ==, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue