assert_ptr_equal(handle->lusb_dev_handle, lusb_handle);
}
+static void test_get_device(void **state)
+{
+ libhusb_device_handle handle;
+ libhusb_device *device;
+
+ device = libhusb_get_device(&handle);
+ assert_ptr_equal(handle.device, device);
+}
/* Custom macro for defining test with given name and fixed teardown function */
#define HUSB_TEST_CTX(func) \
cmocka_unit_test_setup_teardown(func, setup_libhusb_context, teardown_libhusb_context)
+#define HUSB_TEST_NOSETUP(func) \
+ cmocka_unit_test(func)
static struct CMUnitTest tests[] = {
*/
HUSB_TEST_CTX(test_init),
HUSB_TEST_CTX(test_open),
+ HUSB_TEST_NOSETUP(test_get_device),
};