test: object-invoke: Test direct invocation
Test the ConnectionTypeDirect type when the object lives in a different thread. This test passes but generates a memory leak. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
300654217e
commit
d82b8778ed
1 changed files with 21 additions and 0 deletions
|
@ -123,6 +123,27 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
/* Test that direct method invocation bypasses threads. */
|
||||
object_.reset();
|
||||
object_.invokeMethod(&InvokedObject::method,
|
||||
ConnectionTypeDirect, 42);
|
||||
|
||||
switch (object_.status()) {
|
||||
case InvokedObject::NoCall:
|
||||
cout << "Method not invoked for custom thread" << endl;
|
||||
return TestFail;
|
||||
case InvokedObject::CallReceived:
|
||||
cout << "Method invoked in incorrect thread for direct call" << endl;
|
||||
return TestFail;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (object_.value() != 42) {
|
||||
cout << "Method invoked with incorrect value for direct call" << endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test invoking a method that takes reference arguments. This
|
||||
* targets compilation, there's no need to check runtime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue