ADD: Fixed bug in unpacking a simtrack message

This commit is contained in:
Henry Winkel
2023-12-19 18:04:11 +01:00
parent 20dea2bfd0
commit 6a84d6dd65
2 changed files with 4 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ namespace SimCore
}
SimTrack::SimTrack(messages::SimTrack::SimTrack trackMsg)
:ID_(SimCore::Identifier(trackMsg.entityidentifier()))
:ID_(SimCore::Identifier(trackMsg.entityidentifier())),Name(trackMsg.conatactname())
{
WHISPER::SourceType sourcetype = (WHISPER::SourceType)trackMsg.contactsourcetype();
@@ -204,6 +204,7 @@ namespace SimCore
{
messages::SimTrack::SimTrack SimTrack;
if (Name.isValid()) SimTrack.set_conatactname(Name.getValue());
else SimTrack.set_conatactname(" ");

View File

@@ -88,10 +88,11 @@ SCENARIO("Testing the SimCore Track")
REQUIRE(track.getEmission(emi1.getID()).get()->getID() == idEmi);
REQUIRE(msg.get()->msgType_ == WHISPER::SIM_TRACK);
REQUIRE(trackPtr->Speed.getValue() == speed);
REQUIRE(trackPtr->Speed.getValue() == speed);
REQUIRE(trackPtr->getPosition().getGeocentricPos() == GeocentPos1);
REQUIRE(trackDeserialized.getEmission(emi1.getID()).get()->getID() == idEmi);
REQUIRE(trackDeserialized.Name.getValue() == "TEST");