tests: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Michal Privoznik
2019-10-22 15:26:14 +02:00
parent 06030f05bb
commit 4fa804c0c7
87 changed files with 483 additions and 859 deletions

View File

@@ -62,8 +62,7 @@ static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
for (i = 0; i < PATTERN_LEN; i++)
pattern[i] = i;
if (virAsprintf(&file, "%s/input.data", scratchdir) < 0)
goto cleanup;
file = g_strdup_printf("%s/input.data", scratchdir);
if ((fd = open(file, O_CREAT|O_WRONLY|O_EXCL, 0600)) < 0)
goto cleanup;
@@ -194,8 +193,7 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
for (i = 0; i < PATTERN_LEN; i++)
pattern[i] = i;
if (virAsprintf(&file, "%s/input.data", scratchdir) < 0)
goto cleanup;
file = g_strdup_printf("%s/input.data", scratchdir);
if (!(st = virStreamNew(conn, flags)))
goto cleanup;