mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
libqtest: Replace qtest_startf() by qtest_initf()
qtest_init() creates a new QTestState, and leaves @global_qtest alone. qtest_start() additionally assigns it to @global_qtest, but qtest_startf() additionally assigns NULL to @global_qtest. This makes no sense. Replace it by qtest_initf() that works like qtest_init(), i.e. leaves @global_qtest alone. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180806065344.7103-23-armbru@redhat.com>
This commit is contained in:
parent
e3dc93be1a
commit
88b988c895
23 changed files with 80 additions and 82 deletions
|
@ -259,24 +259,23 @@ QTestState *qtest_init(const char *extra_args)
|
|||
return s;
|
||||
}
|
||||
|
||||
QTestState *qtest_vstartf(const char *fmt, va_list ap)
|
||||
QTestState *qtest_vinitf(const char *fmt, va_list ap)
|
||||
{
|
||||
char *args = g_strdup_vprintf(fmt, ap);
|
||||
QTestState *s;
|
||||
|
||||
s = qtest_start(args);
|
||||
s = qtest_init(args);
|
||||
g_free(args);
|
||||
global_qtest = NULL;
|
||||
return s;
|
||||
}
|
||||
|
||||
QTestState *qtest_startf(const char *fmt, ...)
|
||||
QTestState *qtest_initf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
QTestState *s;
|
||||
|
||||
va_start(ap, fmt);
|
||||
s = qtest_vstartf(fmt, ap);
|
||||
s = qtest_vinitf(fmt, ap);
|
||||
va_end(ap);
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue