diff mbox series

[libgpiod,1/7] tests: harness: use correct type to capture a boolean retval

Message ID 20251006-gpiosim-valid-lines-v1-1-b399373e90a9@linaro.org
State New
Headers show
Series tests: update libgpiosim tests and add a uAPI test case for valid lines | expand

Commit Message

Bartosz Golaszewski Oct. 6, 2025, 11:27 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Unlike the libgpiosim functions used in g_gpiosim_glib_apply_properties(),
the return value of g_gpiosim_chip_apply_line_names() is a gboolean so
add a second local variable of the correct type to capture it.

Fixes: daaa6964c9e5 ("tests: rework error handling and stop overusing g_error()")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 tests/gpiosim-glib/gpiosim-glib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/gpiosim-glib/gpiosim-glib.c b/tests/gpiosim-glib/gpiosim-glib.c
index 27ce019c30515e474c2faa326a9cb40b1af55cd7..dd56d91735cb3e78c219addf44ccd6ddba7fd0d2 100644
--- a/tests/gpiosim-glib/gpiosim-glib.c
+++ b/tests/gpiosim-glib/gpiosim-glib.c
@@ -132,6 +132,7 @@  static gboolean g_gpiosim_chip_apply_hogs(GPIOSimChip *self)
 
 static gboolean g_gpiosim_chip_apply_properties(GPIOSimChip *self)
 {
+	gboolean err;
 	int ret;
 
 	ret = gpiosim_bank_set_num_lines(self->bank, self->num_lines);
@@ -154,8 +155,8 @@  static gboolean g_gpiosim_chip_apply_properties(GPIOSimChip *self)
 		}
 	}
 
-	ret = g_gpiosim_chip_apply_line_names(self);
-	if (!ret)
+	err = g_gpiosim_chip_apply_line_names(self);
+	if (!err)
 		return FALSE;
 
 	return g_gpiosim_chip_apply_hogs(self);