Skip to contentSkip to conversation

bindings: cxx: tests: set direction when reconfiguring lines

PATCH Applied Bartosz Golaszewski 2 participants 3 messages Jul 8, 2024 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bindings: cxx: tests: set direction when reconfiguring lines

From: Bartosz Golaszewski <[email protected]>

Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration without direction") made the direction setting mandatory for line config passed to the kernel when reconfiguring requested lines. Fix the C++ test case which doesn't do it and now fails due to the rest of the settings being ignored.

---
 bindings/cxx/tests/tests-line-request.cpp | 1 +
 1 file changed, 1 insertion(+)
bindings/cxx/tests/tests-line-request.cpp +1 -0
index af8b979..a99bd44 100644
@@ -208,6 +208,7 @@ TEST_CASE("values can be read", "[line-request]")
 				.add_line_settings(
 					offs,
 					::gpiod::line_settings()
+						.set_direction(direction::INPUT)
 						.set_active_low(true))
 		);
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration without direction") made the direction setting mandatory for line config passed to the kernel when reconfiguring requested lines. Fix the C++ test case which doesn't do it and now fails due to the rest of the settings being ignored.

---
 bindings/cxx/tests/tests-line-request.cpp | 1 +
 1 file changed, 1 insertion(+)
bindings/cxx/tests/tests-line-request.cpp +0 -0
index af8b979..a99bd44 100644

bindings/cxx/tests/tests-line-request.cpp TEST_CASE("values can be read", "[line-request]") · line 214

Quoted 7 lines
bindings/cxx/tests/tests-line-request.cpp +1 -0
@@ -208,6 +208,7 @@ TEST_CASE("values can be read", "[line-request]")
 				.add_line_settings(
 					offs,
 					::gpiod::line_settings()
+						.set_direction(direction::INPUT)
 						.set_active_low(true))
 		);
 

My bad - I hadn't tried the C++ or Rust tests with that patch, or I would've patched these myself.

for both C++ and Rust.

author Applied
#2 lore raw
In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Quoted 8 lines · Bartosz Golaszewski

Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration without direction") made the direction setting mandatory for line config passed to the kernel when reconfiguring requested lines. Fix the C++ test case which doesn't do it and now fails due to the rest of the settings being ignored.

[...]

Applied, thanks!

[1/1] bindings: cxx: tests: set direction when reconfiguring lines

      commit: 3e224d885b1de54fe5510b9c5e7296260a1a4507

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>