mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
libqos: Use explicit QTestState for i2c operations
Drop one more client of global_qtest by teaching all i2c test functionality to pass in an explicit QTestState, adjusting all callers. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
9b67af76db
commit
f1dfd50732
5 changed files with 66 additions and 65 deletions
|
@ -155,15 +155,13 @@ int main(int argc, char **argv)
|
|||
s = qtest_start("-machine n800 "
|
||||
"-device tmp105,bus=i2c-bus.0,id=" TMP105_TEST_ID
|
||||
",address=0x49");
|
||||
i2c = omap_i2c_create(OMAP2_I2C_1_BASE);
|
||||
i2c = omap_i2c_create(s, OMAP2_I2C_1_BASE);
|
||||
|
||||
qtest_add_func("/tmp105/tx-rx", send_and_receive);
|
||||
|
||||
ret = g_test_run();
|
||||
|
||||
if (s) {
|
||||
qtest_quit(s);
|
||||
}
|
||||
qtest_quit(s);
|
||||
g_free(i2c);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue