Blame SOURCES/0148-tests-Add-a-reference-to-the-enrolled-print-before-r.patch

73b847
From 006cef0a5f97c22c2860d419c8d48fd8c849b58b Mon Sep 17 00:00:00 2001
73b847
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
73b847
Date: Tue, 17 Dec 2019 03:28:12 +0100
73b847
Subject: [PATCH 148/181] tests: Add a reference to the enrolled print before
73b847
 returning it
73b847
73b847
---
73b847
 tests/test-device-fake.c | 4 +++-
73b847
 tests/test-fpi-device.c  | 8 +++++---
73b847
 2 files changed, 8 insertions(+), 4 deletions(-)
73b847
73b847
diff --git a/tests/test-device-fake.c b/tests/test-device-fake.c
73b847
index 096d140..eaa1fa6 100644
73b847
--- a/tests/test-device-fake.c
73b847
+++ b/tests/test-device-fake.c
73b847
@@ -77,7 +77,9 @@ fpi_device_fake_enroll (FpDevice *device)
73b847
     fpi_device_get_enroll_data (device, &print);
73b847
 
73b847
   fake_dev->last_called_function = fpi_device_fake_enroll;
73b847
-  fpi_device_enroll_complete (device, print, fake_dev->ret_error);
73b847
+  fpi_device_enroll_complete (device,
73b847
+                              print ? g_object_ref (print) : NULL,
73b847
+                              fake_dev->ret_error);
73b847
 }
73b847
 
73b847
 static void
73b847
diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c
73b847
index b269ec4..398407a 100644
73b847
--- a/tests/test-fpi-device.c
73b847
+++ b/tests/test-fpi-device.c
73b847
@@ -393,9 +393,9 @@ test_driver_enroll (void)
73b847
 {
73b847
   g_autoptr(GError) error = NULL;
73b847
   g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
73b847
+  g_autoptr(FpPrint) template_print = fp_print_new (device);
73b847
   FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
73b847
   FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
73b847
-  FpPrint *template_print = fp_print_new (device);
73b847
   FpPrint *out_print = NULL;
73b847
 
73b847
   out_print =
73b847
@@ -520,6 +520,7 @@ test_driver_enroll_progress (void)
73b847
 {
73b847
   g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
73b847
   g_autoptr(FpAutoCloseDevice) device = NULL;
73b847
+  g_autoptr(FpPrint) enrolled_print = NULL;
73b847
   ExpectedEnrollData expected_enroll_data = {0};
73b847
   FpiDeviceFake *fake_dev;
73b847
 
73b847
@@ -535,8 +536,9 @@ test_driver_enroll_progress (void)
73b847
   fake_dev = FPI_DEVICE_FAKE (device);
73b847
   fake_dev->user_data = &expected_enroll_data;
73b847
 
73b847
-  fp_device_enroll_sync (device, fp_print_new (device), NULL,
73b847
-                         test_driver_enroll_progress_callback, &expected_enroll_data, NULL);
73b847
+  enrolled_print = fp_device_enroll_sync (device, fp_print_new (device), NULL,
73b847
+                                          test_driver_enroll_progress_callback,
73b847
+                                          &expected_enroll_data, NULL);
73b847
 
73b847
   g_assert (fake_dev->last_called_function == test_driver_enroll_progress_vfunc);
73b847
 }
73b847
-- 
73b847
2.24.1
73b847