summaryrefslogtreecommitdiff
path: root/test/message.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-07-15 07:59:35 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-16 10:55:27 +0300
commitfae053307dcc6807dd8ab127294c1fe5c5bb2d72 (patch)
tree90df0625ef86a0552d382e0211ea18535d687fb5 /test/message.cpp
parent3e29a2d520c9cb8c7b290574bceaadcc107678fa (diff)
libcamera: message: Add user message types
Reserve identifiers for user-defined message types and add an operation to the Message class to register the type identifiers. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test/message.cpp')
-rw-r--r--test/message.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/message.cpp b/test/message.cpp
index de98da3e..3775c30a 100644
--- a/test/message.cpp
+++ b/test/message.cpp
@@ -52,6 +52,17 @@ class MessageTest : public Test
protected:
int run()
{
+ Message::Type msgType[2] = {
+ Message::registerMessageType(),
+ Message::registerMessageType(),
+ };
+
+ if (msgType[0] != Message::UserMessage ||
+ msgType[1] != Message::UserMessage + 1) {
+ cout << "Failed to register message types" << endl;
+ return TestFail;
+ }
+
MessageReceiver receiver;
receiver.moveToThread(&thread_);