From 41e05b1133427c55f265bcea49a2bd3075e4981f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 26 Mar 2020 20:43:34 +0100 Subject: [PATCH] test-fpi-device: Don't compare error pointers that have been cleared During verify/identify complete we replace the error pointer that the driver returned with another error we created, after clearing that one. However, when we initialize a new error the compiler may reuse the same allocation of the cleared one, and this might lead to a test failure. So, don't be so fragile and ignore the pointer check --- tests/test-fpi-device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c index 0e66c2e..ff61849 100644 --- a/tests/test-fpi-device.c +++ b/tests/test-fpi-device.c @@ -959,7 +959,7 @@ test_driver_verify_complete_retry (void) g_test_assert_expected_messages (); g_assert_true (error != g_steal_pointer (&fake_dev->ret_error)); - g_assert_true (error != g_steal_pointer (&fake_dev->user_data)); + g_steal_pointer (&fake_dev->user_data); g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_assert_true (match_data->called); g_assert_error (match_data->error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_TOO_SHORT); @@ -981,7 +981,7 @@ test_driver_verify_complete_retry (void) g_test_assert_expected_messages (); g_assert_true (error != g_steal_pointer (&fake_dev->ret_error)); - g_assert_true (error != g_steal_pointer (&fake_dev->user_data)); + g_steal_pointer (&fake_dev->user_data); g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_assert_true (match_data->called); g_assert_error (match_data->error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_TOO_SHORT); @@ -1001,7 +1001,7 @@ test_driver_verify_complete_retry (void) g_test_assert_expected_messages (); g_assert_true (error != g_steal_pointer (&fake_dev->ret_error)); - g_assert_true (error != g_steal_pointer (&fake_dev->user_data)); + g_steal_pointer (&fake_dev->user_data); g_assert_error (error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_GENERAL); g_assert_true (match_data->called); g_assert_error (match_data->error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_GENERAL); @@ -1296,7 +1296,7 @@ test_driver_identify_complete_retry (void) g_test_assert_expected_messages (); g_assert_true (error != g_steal_pointer (&fake_dev->ret_error)); - g_assert_true (error != g_steal_pointer (&fake_dev->user_data)); + g_steal_pointer (&fake_dev->user_data); g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL); g_assert_true (match_data->called); g_assert_error (match_data->error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_TOO_SHORT);