Files
SimCore/tests/test_DataClass.cpp

39 lines
1014 B
C++

#include <thread>
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <SimCore/data.hpp>
#include <string>
#include <SimCore/Position.hpp>
// SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress
SCENARIO("Testing the SimCore Sensor")
{
GIVEN("different Attributes for a Track in different forms")
{
SimCore::Data<std::string> Name;
Name.setValue("hello world");
WHEN("constructing Track Object with data")
{
THEN("check if Track attributes are correct")
{
REQUIRE(Name.getValue() == "hello world");
REQUIRE(Name.isValid() == true);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
REQUIRE(Name.getWriteTime() < std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
} //THEN
} // WHEN
} // GIVEN
} //SCENARIO