Clarification needed in JUnit5 TestInfo's getTestClass() - unit-testing

fellow Coders.
The getTestClass() of JUnit5's TestInfo returns an 'Optional'. This has me wondering a scenario that would return an Optional.empty().
(Link to TestInfo documentation: https://junit.org/junit5/docs/5.0.0/api/org/junit/jupiter/api/TestInfo.html#getTestClass--)
Apparently I'm yet to figure it out, so I need help guys.

Related

ROS C++: nh.subscribe vs message_filters::Subscriber<> , nh.subscribe works well but message_filters::Subscriber<> does not work

I'm tring to learn ROS topic, but I met a problem that really confused me.
Here is the origin code. It works well, I can receive the image and pass it to CamImgcb.
mSubCam = mNh.subscribe<sensor_msgs::Image>(TopicNameCamSub,10,boost::bind(&ClientHandler::CamImgCb,this,_1));
But when I change it to this code below, CamImgcb can not receive anything, the whole program is stuck to wait for the image to come.
message_filters::Subscriber<sensor_msgs::Image> rgb_sub(mNh, TopicNameCamSub, 10);
rgb_sub.registerCallback(boost::bind(&ClientHandler::CamImgCb,this,_1));
My question is that aren't those two codes means the exact same thing? Why is there a difference between them? I just can't figure it out.
Does anyone know what is the problem? Please help me and thank you so much!
I had a similar issue a while back and found the solution here.
Try changing:
rgb_sub.registerCallback(boost::bind(&ClientHandler::CamImgCb,this,_1));
To:
rgb_sub.registerCallback(&ClientHandler::CamImgCb, this);
Solved it , the solution is here!
https://answers.ros.org/question/406915/nhsubscribe-works-but-message_filterssubscriber-not/

cannot find VehicleObstacleControl module -- in module (veins::PhyLayer80211p)

I have encountered a critical issue in veins-5.2 simulation in the vehicle obstacle shadowing model as follows.
**initializeVehicleObstacleShadowing(): cannot find VehicleObstacleControl module -- in module (veins::PhyLayer80211p)
RSUExampleScenario.rsu[0].nic.phy80211p (id=11), during network initialization**
However, I can find VehicleObstacleControl module in the veins::PhyLayer80211p.cc as follows.
**unique_ptr<AnalogueModel> PhyLayer80211p::initializeVehicleObstacleShadowing(ParameterMap& params)
{
// init with default value
bool useTorus = world->useTorus();
const Coord& playgroundSize = *(world->getPgs());
ParameterMap::iterator it;
VehicleObstacleControl* vehicleObstacleControlP = VehicleObstacleControlAccess().getIfExists();
if (!vehicleObstacleControlP) throw cRuntimeError("initializeVehicleObstacleShadowing(): cannot find VehicleObstacleControl module");
return make_unique<VehicleObstacleShadowing>(this, *vehicleObstacleControlP, useTorus, playgroundSize);
}**
I highly appreciate if you could provide me with some guidance so that I can resolve this problem.
Thank you in advance.
BR.
I have encountered the exactly same issue here. This error can be traced back to PhyLayer80211p.cc and VehicleObstacleControl.h within Veins, and further into OMNet++ files like csimulation.h and cmodule.h. It seems that the wanted scenario just could not find the path of vehicleObstacles (however, for the SimpleObstacleShadowing model, the scenario could find the path of obstacles), which is extremely confusing.
Solved already. In the OMNet++ world, just do not forget about those .ned files. Some modifications needs to be done in the scenario.ned file.

How to pass value to or call a function of AMyPlayerController (APlayerController) from UMenuWidget (UUserWidget) in Unreal, using C++?

My UMenuWidget (derived from UUserWidget) needs to pass a value to AMyPlayerController (derived from APlayerController).
I have tried:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPassParam,int,intData);
But inGameHUD->MenuWidget from AMyPlayerController::BeginPlay() returns NULL, likely because MenuWidget is yet to be created.
This prevents me from add/bind-ing of functions.
How can I do/solve this?
Kindly help me, please.
Thank you.
Link to answer, at UE4 Answer Hub:
https://answers.unrealengine.com/questions/1056641/how-to-pass-value-to-or-call-a-function-of-amyplay.html

Getting list of contacts with gloox

I have followed the included example within the gloox source code but cannot get it to work, nor can I find ANYWHERE through Google that's an example of what I am after. I desire a way to obtain the list of added XMPP contacts (roster, I believe?) upon making a connection to an XMPP server. The code I have currently been trying is below:
void GekkoFyre::TuiHangouts::handleRoster(const Roster &roster)
{
Roster::const_iterator it = roster.begin();
for ( ; it != roster.end(); ++it) {
rosterOutBuf.push_back((*it).second->name().c_str());
}
gui_userRosterList(userListWin, rosterOutBuf, 0);
}
Stepping through the code, I can see that this virtual function does not even activate. What am I doing wrong and can anyone offer a solution? Or even better, an example to follow from? Thank you in advance.
P.S.
I don't even know if this code is written correctly, since I cannot debug it if it doesn't activate!
Nevermind, silly me! I fixed the issue with the following code elsewhere:
#include <gloox/rostermanager.h>
Client *client = new Client(jid, passwd);
client->rosterManager()->registerRosterListener(this);
Apologies if I annoyed anyone.

Implementation of active appearance models

I'm having an internship in the field of computer vision, and i am really interested to know some details about the implementation of the Active Appearence Models aam-opencv that exists in the Google Code site.
In fact, i downloaded aam-opencv.tar.gz then built it with cmake and i solved some syntax problems but the only error that i am still having when i try to generate the solution is the following :
This function should return something:
aamImage* delaunay:: warpImageToMeanShape(aamImage*input)
{
}
I wonder if there is something missing in that function, or is it a compiler problem.
Please give me an answer or just guide me to complete the missing part of that function.
I would really appreciate if anyone kindly help me.
Thank you.
I suppose that is not used in code function, so it is not important what it return. Some C++ compilers allow to write such code and give only warning, another treat as errors:
ReturnType f()
{
}
looks like you use not the same compiler as author of source code. So just add something like:
aamImage* delaunay:: warpImageToMeanShape(aamImage*input)
{
return NULL;
}