summaryrefslogtreecommitdiff
path: root/tests/ds1338-test.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-09-11 12:19:59 -0500
committerThomas Huth <thuth@redhat.com>2018-02-14 11:43:41 +0100
commitf1dfd507325f25a73d777db5f5d9b3fcac89287b (patch)
tree2488bf7c46c78f5e557bad3df6683333f96880c3 /tests/ds1338-test.c
parent9b67af76dbe62960794055a732f1e47680621192 (diff)
downloadqemu-f1dfd507325f25a73d777db5f5d9b3fcac89287b.tar.gz
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>
Diffstat (limited to 'tests/ds1338-test.c')
-rw-r--r--tests/ds1338-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/ds1338-test.c b/tests/ds1338-test.c
index 26968bc82a..742dad9113 100644
--- a/tests/ds1338-test.c
+++ b/tests/ds1338-test.c
@@ -61,16 +61,14 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
s = qtest_start("-display none -machine imx25-pdk");
- i2c = imx_i2c_create(IMX25_I2C_0_BASE);
+ i2c = imx_i2c_create(s, IMX25_I2C_0_BASE);
addr = DS1338_ADDR;
qtest_add_func("/ds1338/tx-rx", send_and_receive);
ret = g_test_run();
- if (s) {
- qtest_quit(s);
- }
+ qtest_quit(s);
g_free(i2c);
return ret;