-
|
Let's consider the following component: active component MyComponent { Ports are defined as follows: Implementation: void MyComponent::run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { Started to write unit test: void MyComponent:: My question is in testAveraging comment above. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
I understood how to mock output ports getData1, getData2 and getData3. Just needed to implement automatically generated functions: from_getData1_handler, from_getData2_handler, from_getData3_handler. The next problem is that this->invoke_to_run(0, 0); seems to not invoke run_handler logic |
Beta Was this translation helpful? Give feedback.
-
|
It seems that run handler is not invoked because it async port... Because if I change it to sync, test runs properly. What should be done to handle async ports? |
Beta Was this translation helpful? Give feedback.
-
|
Got it! It was needed to call this->component.doDispatch(); just after run port invocation |
Beta Was this translation helpful? Give feedback.
I understood how to mock output ports getData1, getData2 and getData3. Just needed to implement automatically generated functions: from_getData1_handler, from_getData2_handler, from_getData3_handler.
The next problem is that this->invoke_to_run(0, 0); seems to not invoke run_handler logic