summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-27 02:45:17 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-29 16:44:46 +0200
commitfb1a5c0416ebd516a5ef01ba76deed1b602828ba (patch)
tree58a18ff78d6179a3deedb74750aca2214fce7d39 /test
parent06008b9156b74885aa2382dec9dc8c7854ca6f2e (diff)
libcamera: object: Add connection type parameter to invokeMethod()
Allow specifying a different connection type than ConnectionTypeQueued for Object::invokeMethod(). Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test')
-rw-r--r--test/object-invoke.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp
index 37a27440..f6ae2604 100644
--- a/test/object-invoke.cpp
+++ b/test/object-invoke.cpp
@@ -64,10 +64,11 @@ protected:
InvokedObject object;
/*
- * Test that method invocation in the same thread goes through
- * the event dispatcher.
+ * Test that queued method invocation in the same thread goes
+ * through the event dispatcher.
*/
- object.invokeMethod(&InvokedObject::method, 42);
+ object.invokeMethod(&InvokedObject::method,
+ ConnectionTypeQueued, 42);
if (object.status() != InvokedObject::NoCall) {
cerr << "Method not invoked asynchronously" << endl;
@@ -93,15 +94,16 @@ protected:
}
/*
- * Move the object to a thread and verify that the method is
- * delivered in the correct thread.
+ * Move the object to a thread and verify that auto method
+ * invocation is delivered in the correct thread.
*/
object.reset();
object.moveToThread(&thread_);
thread_.start();
- object.invokeMethod(&InvokedObject::method, 42);
+ object.invokeMethod(&InvokedObject::method,
+ ConnectionTypeAuto, 42);
this_thread::sleep_for(chrono::milliseconds(100));
switch (object.status()) {