[libcamera-devel] [PATCH] test: signal: Exercise the signal delivery code paths for Object

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Apr 27 14:16:08 CEST 2019


Member slots for objects deriving from the Object class receive special
handling. Add one test to make sure we exercise the related code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 test/signal.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/signal.cpp b/test/signal.cpp
index 19a52c603a4a..bc579cca37e4 100644
--- a/test/signal.cpp
+++ b/test/signal.cpp
@@ -176,6 +176,18 @@ protected:
 		delete signal;
 		delete slotObject;
 
+		/* Exercise the the Object slot code paths. */
+		slotObject = new SlotObject();
+		signalVoid_.connect(slotObject, &SlotObject::slot);
+		valueStatic_ = 0;
+		signalVoid_.emit();
+		if (valueStatic_ == 0) {
+			cout << "Signal delivery for Object test failed" << endl;
+			return TestFail;
+		}
+
+		delete slotObject;
+
 		return TestPass;
 	}
 
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list