Commit 49b6ae44 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Adapt tests, apps and benchmarks to removed reference ID

parent 41581e45
......@@ -183,7 +183,6 @@ void normalize_0dB( ITASampleFrame* p )
void LoadTask ( CSimulationTask& oTask, const std::string& sPath )
{
oTask.uiID = INIFileReadUInt ( sPath, "Task", "ID", 0 );
oTask.uiReferenceID = INIFileReadUInt ( sPath, "Task", "ReferenceID", 0 );
std::string sSimulationType = INIFileReadString ( sPath, "Task", "Simulation", "DS+ER_IS+DD_RT" );
auto eSimulationType = ParseSimulationType ( sSimulationType );
oTask.eSimulationType = eSimulationType;
......
......@@ -79,7 +79,7 @@ int main ( )
masterController->AttachResultHandler ( resultHandler.get ( ) );
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
auto source = std::make_unique<C3DObject> (
VistaVector3D ( 1, 1.5, 1 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 1 );
auto receiver = std::make_unique<C3DObject> (
......
......@@ -22,8 +22,8 @@ int main ( )
{
const int runs = 500000;
CUpdateScene prevUpdate ( 0 );
CUpdateScene newUpdate ( 0 );
CUpdateScene prevUpdate;
CUpdateScene newUpdate;
C3DObject source ( VistaVector3D ( 0, 0, 0 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
C3DObject receiver ( VistaVector3D ( 0, 0, 0 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::receiver, 0 );
......
......@@ -90,7 +90,7 @@ struct CompleteTest : public testing::Test, public ITATimerEventHandler
void handleTimerEvent(const ITATimer& tSource) override
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
auto source = std::make_unique<C3DObject> (
VistaVector3D ( 1, 1.5, 1 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 1 );
auto receiver = std::make_unique<C3DObject> (
......@@ -105,7 +105,7 @@ struct CompleteTest : public testing::Test, public ITATimerEventHandler
TEST_F ( CompleteTest, DISABLED_correctResult )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
auto source = std::make_unique<C3DObject> (
VistaVector3D ( 1, 1.5, 1 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 1 );
auto receiver = std::make_unique<C3DObject> (
......
......@@ -100,8 +100,8 @@ TEST_P ( FilterNetworkTest, correctResult )
{
const auto param = GetParam ( );
const CUpdateScene update1 ( 0 );
const CUpdateScene update2 ( 0 );
const CUpdateScene update1;
const CUpdateScene update2;
EXPECT_EQ ( param.expectedResult, filterNetwork->EvaluateNetwork ( update1, update2 ) );
}
......
......@@ -27,7 +27,7 @@ TEST ( RateFilterTest, filterCorrect )
for ( auto& u : updates )
{
u = CUpdateScene ( 0 );
u = CUpdateScene ( );
VistaTimeUtils::Sleep ( 250 );
}
......@@ -72,7 +72,7 @@ TEST ( ZoneFilter, correctResult )
CZoneFilter filter ( conf );
CUpdateScene update ( 0 );
CUpdateScene update;
auto sourceInside = C3DObject ( VistaVector3D ( 0.5f, 0.5f, 0.5f ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
auto sourceOutside = C3DObject ( VistaVector3D ( 1.5f, 5.5f, 4 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
......@@ -96,7 +96,7 @@ TEST ( TranslationFilter, correctResultAbsolut )
CTranslationFilter filter ( conf );
CUpdateScene prevUpdate ( 0 );
CUpdateScene prevUpdate;
prevUpdate.SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::source,
......@@ -105,7 +105,7 @@ TEST ( TranslationFilter, correctResultAbsolut )
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::receiver,
0 ) );
CUpdateScene newUpdate ( 0 );
CUpdateScene newUpdate;
auto sourceNear = C3DObject ( VistaVector3D ( 0.5f, 0.5f, 0.5f ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
auto source1m = C3DObject ( VistaVector3D ( 1, 0, 0 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
......@@ -186,7 +186,7 @@ struct RotationFilterTest : public testing::TestWithParam<RotationFilterTestPara
filter = std::make_unique<CRotationFilter> ( conf );
prevUpdate = std::make_unique<CUpdateScene> ( 0 );
prevUpdate = std::make_unique<CUpdateScene> ( );
prevUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::source,
......@@ -201,7 +201,7 @@ struct RotationFilterTest : public testing::TestWithParam<RotationFilterTestPara
TEST_P ( RotationFilterTest, correctResult )
{
const auto param = GetParam ( );
CUpdateScene newUpdate ( 0 );
CUpdateScene newUpdate;
auto source = C3DObject ( param.sourcePos, VistaAxisAndAngle ( param.sourceRotAxis, param.sourceRotDeg * ITAConstants::PI_D / 180.0 ), C3DObject::Type::source, 0 );
auto receiver = C3DObject ( param.receiverPos, VistaAxisAndAngle ( param.receiverRotAxis, param.receiverRotDeg * ITAConstants::PI_D / 180.0 ), C3DObject::Type::receiver, 0 );
......@@ -251,9 +251,9 @@ TEST ( DistanceFilter, correctResult )
CDistanceFilter filter ( conf );
CUpdateScene oldUpdate ( 0 );
CUpdateScene oldUpdate;
CUpdateScene newUpdate ( 0 );
CUpdateScene newUpdate;
auto sourceInside1 = C3DObject ( VistaVector3D ( 0.5f, 0.5f, 0.5f ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
auto sourceInside2 = C3DObject ( VistaVector3D ( 4.99f, 0, 0 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::source, 0 );
......@@ -329,7 +329,7 @@ struct PerceptiveRotationFilterTest : public testing::TestWithParam<PerceptiveRo
filter = std::make_unique<CPerceptiveRotationFilter> ( conf );
prevUpdate = std::make_unique<CUpdateScene> ( 0 );
prevUpdate = std::make_unique<CUpdateScene> ( );
prevUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::source,
......@@ -344,7 +344,7 @@ struct PerceptiveRotationFilterTest : public testing::TestWithParam<PerceptiveRo
TEST_P ( PerceptiveRotationFilterTest, correctResult )
{
const auto param = GetParam ( );
CUpdateScene newUpdate ( 0 );
CUpdateScene newUpdate;
auto source = C3DObject ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
......@@ -390,7 +390,7 @@ TEST ( TranslationFilter, correctResultRelative )
CTranslationFilter filter ( conf );
CUpdateScene prevUpdate ( 0 );
CUpdateScene prevUpdate;
prevUpdate.SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::source,
......@@ -399,7 +399,7 @@ TEST ( TranslationFilter, correctResultRelative )
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::receiver,
0 ) );
CUpdateScene newUpdate ( 0 );
CUpdateScene newUpdate;
newUpdate.SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D ( 0, 0, 0 ),
VistaQuaternion ( 0, 0, 0, 1 ),
C3DObject::Type::source,
......
......@@ -52,7 +52,7 @@ struct LocalSchedulerTest : public testing::Test
schedulerConfig.vpWorkerConfigs = { workerConfig };
auto filterConfig = std::make_shared<MockAudibilityFilter::MockFilterConfig> ( );
filterConfig->behaviour = MockAudibilityFilter::Behaviour::onlyID_42_audible;
filterConfig->behaviour = MockAudibilityFilter::Behaviour::onlySourceID_42_audible;
filterConfig->sFilterName = "Filter";
AudibilityFilter::CFilterNetwork::FilterNetworkConfig filterNetworkConfig;
filterNetworkConfig.vpFilterConfigs = { filterConfig };
......@@ -117,7 +117,7 @@ TEST_F ( LocalSchedulerTest, UpdateToWorker )
VistaTimeUtils::Sleep ( 50 );
}
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
......@@ -136,7 +136,7 @@ TEST_F ( LocalSchedulerTest, UpdateToHandler )
{
for ( int i = 0; i < 50; ++i )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
......@@ -151,7 +151,7 @@ TEST_F ( LocalSchedulerTest, UpdateToHandler )
TEST_F ( LocalSchedulerTest, UpdateToHandler1 )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
......@@ -176,7 +176,7 @@ TEST_F ( LocalSchedulerTest, Filter )
{
for ( int i = 0; i < 50; ++i )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
......@@ -188,7 +188,7 @@ TEST_F ( LocalSchedulerTest, Filter )
// Send another bunch of updates afterwards, so the filter replace is not being used.
for ( int i = 0; i < 50; ++i )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
......@@ -207,24 +207,24 @@ TEST_F ( LocalSchedulerTest, correctNumberOfResults )
{
for (auto j = 0; j<3;++j)
{
auto update = std::make_unique<CUpdateScene> ( j );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
}
auto update = std::make_unique<CUpdateScene> ( 42 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 42 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PushUpdate ( std::move ( update ) );
// We have to wait a bit for the thread inside the controller to do its thing. And the second bunch is not replaced by filterReplace.
VistaTimeUtils::Sleep ( 250 );
VistaTimeUtils::Sleep ( 500 );
}
// We have to wait a bit for the thread inside the controller to do its thing.
VistaTimeUtils::Sleep ( 250 );
// The first update is always done
EXPECT_EQ ( handler->resultVector.size ( ), 5 );
EXPECT_EQ ( handler->resultVector.size ( ), 3 );
}
\ No newline at end of file
......@@ -49,7 +49,7 @@ TEST_F ( MasterSimulationControllerTest, uptadeToScheduler )
//std::unique_ptr<CUpdateScene> update;
for ( int i = 0; i < 50; ++i )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
controller->PushUpdate ( std::move ( update ) );
......@@ -68,7 +68,7 @@ TEST_F ( MasterSimulationControllerTest, attachResultHandler )
{
for ( int i = 0; i < 50; ++i )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
controller->PushUpdate ( std::move ( update ) );
......
......@@ -155,7 +155,7 @@ struct MockAudibilityFilter : public AudibilityFilter::IAudibilityFilter
{
nothingAudible,
everythingAudible,
onlyID_42_audible
onlySourceID_42_audible
};
struct MockFilterConfig : AudibilityFilterConfig
......@@ -192,8 +192,8 @@ struct MockAudibilityFilter : public AudibilityFilter::IAudibilityFilter
return false;
case Behaviour::everythingAudible:
return true;
case Behaviour::onlyID_42_audible:
if ( newUpdate.GetReferenceID ( ) == 42 )
case Behaviour::onlySourceID_42_audible:
if ( newUpdate.GetSourceReceiverPair().source->GetId() == 42 )
return true;
return false;
default:
......
......@@ -28,7 +28,7 @@ struct RavenWorkerInterfaceTest : testing::Test
TEST_F ( RavenWorkerInterfaceTest, update2Task )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
auto source = std::make_unique<C3DObject> (
VistaVector3D ( 3, 2, 6 ), VistaQuaternion ( 1, 0, 0, 0 ), C3DObject::Type::source, 1 );
auto receiver = std::make_unique<C3DObject> (
......@@ -42,7 +42,6 @@ TEST_F ( RavenWorkerInterfaceTest, update2Task )
const auto task = interface->createTaskFromUpdateTest ( std::move ( update ) );
EXPECT_EQ ( updateCopy.GetID ( ), task->uiID );
EXPECT_EQ ( updateCopy.GetReferenceID ( ), task->uiReferenceID );
EXPECT_EQ ( FieldOfDuty::directSound, task->eSimulationType );
auto sourceFormUpdate = updateCopy.GetSourceReceiverPair ( ).source;
......@@ -87,7 +86,6 @@ TEST_F ( RavenWorkerInterfaceTest, resultConversion )
auto pTask = std::make_unique<CSimulationTask> ( );
pTask->eSimulationType = FieldOfDuty::earlyReflections;
pTask->uiReferenceID = 314;
pTask->oScene.AddSource ( 0 );
auto sourceState = CRavenScene::CSourceState ( );
......@@ -122,7 +120,6 @@ TEST_F ( RavenWorkerInterfaceTest, resultConversion )
EXPECT_EQ ( pRavenResultCopy->vcspResult [0]->psfResult->operator[]( 1 ) [i], pResult->sfResult [1][i] );
}
EXPECT_EQ ( pTask->uiReferenceID, pResult->iReferenceID );
EXPECT_EQ ( pTask->eSimulationType, pResult->eResultType );
const auto sourceFormResult = pResult->sourceReceiverPair.source;
......
......@@ -41,7 +41,7 @@ struct RavenWorkerThreadTest : testing::Test
TEST_F ( RavenWorkerThreadTest, updateToSimulatorAndResultToScheduler )
{
auto update = std::make_unique<CUpdateScene> ( 1 );
auto update = std::make_unique<CUpdateScene> ( );
auto source = std::make_unique<C3DObject> (
VistaVector3D ( 3, 2, 6 ), VistaQuaternion ( 1, 0, 0, 0 ), C3DObject::Type::source, 1 );
auto receiver = std::make_unique<C3DObject> (
......
......@@ -15,12 +15,29 @@ TEST ( ReplacementFilter, filterReplace1 )
{
std::list<std::unique_ptr<IUpdateMessage>> list;
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
auto lastUpdate = std::make_unique<CUpdateScene> ( 1 );
std::unique_ptr<CUpdateScene> tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D{ 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion{ 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
auto lastUpdate = std::make_unique<CUpdateScene> ( );
lastUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
auto rawLastUpdate = lastUpdate.get ( );
......@@ -58,11 +75,27 @@ TEST ( ReplacementFilter, filterReplace3 )
{
std::list<std::unique_ptr<IUpdateMessage>> list;
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 2 ) );
std::unique_ptr<CUpdateScene> tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 1 ) );
list.push_back ( std::move ( tmpUpdate ) );
list.push_back ( std::make_unique<CUpdateConfig> ( ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 2 ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 1 ) );
list.push_back ( std::move ( tmpUpdate ) );
CReplacementFilter::FilterReplace ( list );
......@@ -73,12 +106,29 @@ TEST ( ReplacementFilter, filterReplace4 )
{
std::list<std::unique_ptr<CUpdateScene>> list;
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
auto lastUpdate = std::make_unique<CUpdateScene> ( 1 );
std::unique_ptr<CUpdateScene> tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
tmpUpdate = std::make_unique<CUpdateScene> ( );
tmpUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
list.push_back ( std::move ( tmpUpdate ) );
auto lastUpdate = std::make_unique<CUpdateScene> ( );
lastUpdate->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::source, 0 ),
std::make_unique<C3DObject> ( VistaVector3D { 0, 0, 0 }, VistaQuaternion { 0, 0, 0, 1 }, C3DObject::Type::receiver, 0 ) );
auto rawLastUpdate = lastUpdate.get ( );
......
......@@ -29,7 +29,6 @@ TEST ( SimulationResultTests, simulationResultSerialize )
result->sourceReceiverPair.source = source;
result->sourceReceiverPair.receiver = receiver;
result->iReferenceID = 0;
auto serializer = VistaByteBufferSerializer ( );
auto deserializer = VistaByteBufferDeSerializer ( );
......@@ -46,7 +45,6 @@ TEST ( SimulationResultTests, simulationResultSerialize )
EXPECT_EQ ( *result->sourceReceiverPair.source, *newResult.sourceReceiverPair.source );
EXPECT_EQ ( *result->sourceReceiverPair.receiver, *newResult.sourceReceiverPair.receiver );
EXPECT_EQ ( result->iReferenceID, newResult.iReferenceID );
}
TEST ( SimulationResultTests, IRsimulationResultSerialize )
......@@ -61,7 +59,6 @@ TEST ( SimulationResultTests, IRsimulationResultSerialize )
result->sourceReceiverPair.source = source;
result->sourceReceiverPair.receiver = receiver;
result->iReferenceID = 0;
result->iLeadingZeros = 10;
result->iTrailingZeros = 30;
result->bZerosStripped = false;
......@@ -86,7 +83,6 @@ TEST ( SimulationResultTests, IRsimulationResultSerialize )
EXPECT_EQ ( writeBytes, readBytes );
EXPECT_EQ ( result->iReferenceID, newResult.iReferenceID );
EXPECT_EQ ( result->bZerosStripped, newResult.bZerosStripped );
EXPECT_EQ ( result->iTrailingZeros, newResult.iTrailingZeros );
EXPECT_EQ ( result->iLeadingZeros, newResult.iLeadingZeros );
......@@ -109,7 +105,6 @@ TEST ( SimulationResultTests, RIRsimulationResultSerialize )
result->sourceReceiverPair.source = source;
result->sourceReceiverPair.receiver = receiver;
result->iReferenceID = 0;
result->iLeadingZeros = 10;
result->iTrailingZeros = 30;
result->bZerosStripped = false;
......@@ -136,7 +131,6 @@ TEST ( SimulationResultTests, RIRsimulationResultSerialize )
EXPECT_EQ ( writeBytes, readBytes );
EXPECT_EQ ( result->iReferenceID, newResult.iReferenceID );
EXPECT_EQ ( result->bZerosStripped, newResult.bZerosStripped );
EXPECT_EQ ( result->iTrailingZeros, newResult.iTrailingZeros );
EXPECT_EQ ( result->iLeadingZeros, newResult.iLeadingZeros );
......
......@@ -26,7 +26,7 @@ struct UpdateSceneTest : testing::Test
UpdateSceneTest ( )
{
update = std::make_unique<simsched::CUpdateScene> ( 1 );
update = std::make_unique<simsched::CUpdateScene> ( );
source = std::make_unique<simsched::C3DObject> (
VistaVector3D ( 3, 2, 6 ), VistaQuaternion ( 1, 0, 0, 0 ), simsched::C3DObject::Type::source, 1 );
receiver = std::make_unique<simsched::C3DObject> (
......@@ -43,7 +43,6 @@ struct UpdateSceneTest : testing::Test
TEST_F ( UpdateSceneTest, getter )
{
EXPECT_EQ ( 1, update->GetReferenceID ( ) );
EXPECT_GE ( update->GetID ( ), 0 );
auto pair = update->GetSourceReceiverPair ( );
......@@ -53,7 +52,7 @@ TEST_F ( UpdateSceneTest, getter )
TEST_F ( UpdateSceneTest, operatorEqual )
{
auto alt1 = simsched::CUpdateScene ( 1 );
auto alt1 = simsched::CUpdateScene ( );
alt1.SetSourceReceiverPair ( std::make_unique<simsched::C3DObject> ( *raw_source ),
std::make_unique<simsched::C3DObject> ( *raw_receiver ) );
......@@ -63,7 +62,7 @@ TEST_F ( UpdateSceneTest, operatorEqual )
TEST_F ( UpdateSceneTest, operatorEqualTol )
{
auto alt1 = simsched::CUpdateScene ( 1 );
auto alt1 = simsched::CUpdateScene ( );
auto altSource = simsched::C3DObject ( { 3.14f, 2.5f, 6 }, {1,0.05f,0,0.1f}, simsched::C3DObject::Type::source, 1 );
alt1.SetSourceReceiverPair ( std::make_unique<simsched::C3DObject> ( altSource ),
std::make_unique<simsched::C3DObject> ( *raw_receiver ) );
......@@ -97,7 +96,7 @@ TEST_F( UpdateSceneTest , copyConstructor)
TEST_F ( UpdateSceneTest, relationalOperators )
{
const auto laterUpdate = std::make_unique<simsched::CUpdateScene> ( 1 );
const auto laterUpdate = std::make_unique<simsched::CUpdateScene> ( );
EXPECT_TRUE ( *update < *laterUpdate );
EXPECT_FALSE( *update > *laterUpdate );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment