diff options
author | Richard Hughes <richard@hughsie.com> | 2015-05-27 13:48:40 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-05-27 13:48:55 +0100 |
commit | 8a9cd0cfbcfe80623a258fd8d0fea7d788d395bb (patch) | |
tree | 24fde7ab39db8bef926c0e0e29e42bf7bc2942d2 | |
parent | 039aa5afc85e5e3606055b92bf4e6627e9229034 (diff) | |
download | colord-8a9cd0cfbcfe80623a258fd8d0fea7d788d395bb.tar.gz |
trivial: Ensure the device is properly closed when running self tests
-rw-r--r-- | lib/colorhug/ch-self-test.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/colorhug/ch-self-test.c b/lib/colorhug/ch-self-test.c index 40844c8..22ab5fc 100644 --- a/lib/colorhug/ch-self-test.c +++ b/lib/colorhug/ch-self-test.c @@ -636,6 +636,11 @@ ch_test_state_func (void) g_timer_destroy (timer); } + /* close */ + ret = g_usb_device_close (device, &error); + g_assert_no_error (error); + g_assert (ret); + g_object_unref (device_queue); } @@ -964,6 +969,11 @@ ch_test_reading_func (void) g_assert (ret); g_assert_cmpint (take_reading, >, 0); + /* close */ + ret = g_usb_device_close (device, &error); + g_assert_no_error (error); + g_assert (ret); + g_object_unref (device); g_object_unref (device_queue); } @@ -1098,6 +1108,12 @@ ch_test_reading_xyz_func (void) g_assert_cmpfloat (scaling_factor_actual, <, 1.1); reading1.Z = reading2.Z * 2; } + + /* close */ + ret = g_usb_device_close (device, &error); + g_assert_no_error (error); + g_assert (ret); + g_object_unref (device); g_object_unref (device_queue); } |