Files
EntityLibrary/tests/test_EntityClass.cpp
2023-03-18 19:36:53 +01:00

74 lines
2.0 KiB
C++

#include "SimCore/Identifier.hpp"
#include "SimCore/Orientation.hpp"
#include "SimCore/Position.hpp"
#include "WHISPER/Messages/Message.hpp"
#include <SimCore/SimCore.hpp>
#include <memory>
#include <string>
#include <thread>
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <Entities/Entity.hpp>
// SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress
class Ship : public Entities::Entity
{
public:
Ship(SimCore::Identifier OwnID,
std::string EntityName,
WHISPER::SourceType ownType,
SimCore::Identifier ParentID,
SimCore::EntityKind EntityKind,
std::uint32_t GroundTruthPort,
std::uint32_t CommandPort,
std::string CommandIPAddress):
Entity( OwnID,EntityName,ownType, ParentID, EntityKind, GroundTruthPort, CommandPort, CommandIPAddress)
{
this->ownShipPosition_ = std::make_shared<SimCore::Position>();
this->ownShipOrientation_ = std::make_shared<SimCore::Orientation>();
}
private:
void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) override
{
LOG_S(INFO)<<"calculating every " << duration << "milliseconds";
};
void specificReloadCharacteristicts() override
{
LOG_S(INFO)<<"loading specifications";
};
};
SCENARIO("Testing the SimCore Sensor")
{
GIVEN("different Attributes for a Track in different forms")
{
SimCore::Identifier IDParent(0,1,false);
SimCore::Identifier ID1(0,2,false);
Ship Ship(ID1,"FGS Hamburg",WHISPER::SourceType::SHIP,IDParent,SimCore::EntityKind::SURFACE,8000,8001,"127.0.0.1");
Ship.start();
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
Ship.stop();
WHEN("constructing Track Object with data")
{
THEN("check if Track attributes are correct")
{
// REQUIRE(testOperator == true);
} //THEN
} // WHEN
} // GIVEN
} //SCENARIO