diff --git a/src/SimCore/Messages/SimTrack.cpp b/src/SimCore/Messages/SimTrack.cpp index 352ff49..c749414 100644 --- a/src/SimCore/Messages/SimTrack.cpp +++ b/src/SimCore/Messages/SimTrack.cpp @@ -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(" "); diff --git a/tests/test_SimTrack.cpp b/tests/test_SimTrack.cpp index cd9b82d..60c6694 100644 --- a/tests/test_SimTrack.cpp +++ b/tests/test_SimTrack.cpp @@ -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");