ADD: added function that gives a shared_pointer to the ID of the Track

This commit is contained in:
Henry Winkel
2023-01-10 21:10:30 +01:00
parent 5597e85b83
commit bdacd2fc01
11 changed files with 82 additions and 41 deletions

View File

@@ -1,3 +1,4 @@
#include "SimCore/IdentifierMaker.hpp"
#include <SimCore/Messages/Track.hpp>
#include <WHISPER/Messages/Message.hpp>
#include <SimCore/SimCore.hpp>
@@ -29,6 +30,8 @@ SCENARIO("Testing the SimCore Track")
std::shared_ptr<WHISPER::Message> msg = NULL;
std::shared_ptr<SimCore::Track> trackPtr = NULL;
SimCore::IdentifierMaker IDMaker;
auto ID = IDMaker.getNewIdentifier(SimCore::ObjectSource::EXTERNAL);
std::string serializedMSG;
@@ -36,8 +39,7 @@ SCENARIO("Testing the SimCore Track")
WHEN("constructing Track Object with data")
{
SimCore::Position pos( GeocentPos1(SimCore::GeocentricPosition::X), GeocentPos1(SimCore::GeocentricPosition::Y), GeocentPos1(SimCore::GeocentricPosition::Z));
SimCore::Track track(1,WHISPER::SourceType::SHIP,10,false);
SimCore::Track track(1,WHISPER::SourceType::SHIP,*ID.get());
track.setCourse(course);
track.setSpeed(speed);
track.setPosition(GeocentPos1(SimCore::X),GeocentPos1(SimCore::Y),GeocentPos1(SimCore::Z));
@@ -64,6 +66,8 @@ SCENARIO("Testing the SimCore Track")
REQUIRE(msg.get()->msgType_ == WHISPER::RAW_TRACK);
REQUIRE(trackPtr->getSpeed() == speed);
REQUIRE(trackPtr->getPostion().getGeocentricPos() == GeocentPos1);
REQUIRE(trackPtr->getIdentifier()->getNumber() > 0);