Commit 638ac3b7 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

Tests

- added empty test for ART
parent 54da2ae4
# $Id:$
set( RelativeDir "ART" )
set( RelativeSourceGroup "Source Files\\ART" )
set( SubDirs )
set( DirFiles
art_simulator_test.cpp
)
set( DirFiles_SourceGroup "${RelativeSourceGroup}" )
set( LocalSourceGroupFiles )
foreach( File ${DirFiles} )
list( APPEND LocalSourceGroupFiles "${RelativeDir}/${File}" )
list( APPEND ProjectSources "${RelativeDir}/${File}" )
endforeach()
source_group( ${DirFiles_SourceGroup} FILES ${LocalSourceGroupFiles} )
set( SubDirFiles "" )
foreach( Dir ${SubDirs} )
list( APPEND SubDirFiles "${RelativeDir}/${Dir}/_SourceFiles.cmake" )
endforeach()
foreach( SubDirFile ${SubDirFiles} )
include( ${SubDirFile} )
endforeach()
// simulation scheduler includes
#include <ITA/SimulationScheduler/utils/utils.h>
#include <ITA/SimulationScheduler/OutdoorAcoustics/ART/art_simulator.h>
//#include <ITA/SimulationScheduler/OutdoorAcoustics/outdoor_simulation_result.h>
//#include <ITA/SimulationScheduler/RoomAcoustics/Raven/simulator.h>
// ITA includes
//#include <ITAFFT.h>
//#include <ITAHDFTSpectra.h>
//#include <ITAAudiofileReader.h>
//#include <ITAAudiofileWriter.h>
//#include <ITAHDFTSpectrum.h>
// STD
#include <iostream>
#include <string>
#include <memory>
#include <ostream>
#include <valarray>
// GTest
#include "gtest/gtest.h"
using namespace ITA::SimulationScheduler;
using namespace ITA::SimulationScheduler::Utils;
using namespace ITA::SimulationScheduler::OutdoorAcoustics;
//using namespace ITA::SimulationScheduler::RoomAcoustics;
//using namespace ITA::SimulationScheduler::RoomAcoustics::Raven;
//TEST ( SimulatorTest, WriteRPF )
//{
// auto simulator = std::make_unique<CSimulator> (
// FieldOfDuty::directSound,
// "D:/ScieBo/MasterThesis/Raven/RavenInput/Cube/referenceNEW.rpf" );
//
// CRavenScene::CReceiverState oReceiverState;
// oReceiverState.vPos.init ( 0, 1, 0 );
// oReceiverState.vView.init ( 0, 0, -1 );
// oReceiverState.vUp.init ( 0, 1, 0 );
//
// CRavenScene::CSourceState oSourceState;
// oSourceState.vPos.init ( 0, 1, 0 );
// oSourceState.vView.init ( 0, 0, -1 );
// oSourceState.vUp.init ( 0, 1, 0 );
//
// auto oTask = new CSimulationTask;
//
// oTask->oScene.AddReceiver ( 0 );
// oTask->oScene.SetReceiverState ( 0, oReceiverState );
// oTask->oScene.AddSource ( 0 );
// oTask->oScene.SetSourceState ( 0, oSourceState );
// oTask->eSimulationType = FieldOfDuty::earlyReflections;
// oTask->uiID = 0;
//
// auto result = new CRavenSimulationResult ( );
//
// simulator->Compute ( oTask, result );
//
// if ( !doesDirectoryExist ( "results" ) )
// makeDirectory ( "results" );
//
// EXPECT_NO_THROW ( simulator->WriteToRpf ( "results/WriteRPFTest.rpf" ) );
//}
struct ARTSimulatorParam
{
struct SceneParam
{
std::string sAtmosphereJsonFile;
VistaVector3D v3SourcePosition;
VistaVector3D v3ReceiverPosition;
friend std::ostream& operator<<( std::ostream& os, const SceneParam& obj )
{
return os
<< "scene: " << obj.sAtmosphereJsonFile
<< " sourcePosition: " << obj.v3SourcePosition[0] << ", " << obj.v3SourcePosition[1] << ", " << obj.v3SourcePosition[2]
<< " sourcePosition: " << obj.v3ReceiverPosition[0] << ", " << obj.v3ReceiverPosition[1] << ", " << obj.v3ReceiverPosition[2];
}
};
struct MiscParam
{
int runs;
double acceptableStdDev; // ~6
double correlationThreshold; // >0.9 for deterministic results
bool saveResults;
friend std::ostream& operator<<( std::ostream& os, const MiscParam& obj )
{
return os
<< "runs: " << obj.runs
<< " acceptableStdDev: " << obj.acceptableStdDev
<< " correlationThreshold: " << obj.correlationThreshold;
}
};
};
struct ARTSimulatorTestParam : testing::TestWithParam<std::tuple<ARTSimulatorParam::SceneParam, ARTSimulatorParam::MiscParam>>
{
std::unique_ptr< ART::CARTSimulator > pSimulator;
std::unique_ptr< CUpdateScene > pUpdateScene;
//ITABase::CMultichannelFiniteImpulseResponse reference;
ARTSimulatorTestParam( )
{
}
static bool ResultsAreIdentical ( const ITABase::CMultichannelFiniteImpulseResponse& reference, const COutdoorSimulationResult& secondResult )
{
return false;
}
static bool CompareResults ( const ITABase::CMultichannelFiniteImpulseResponse& reference, const std::vector<COutdoorSimulationResult>& secondResults, const double& acceptedStandardDeviation )
{
return false;
}
};
//TEST_P(SimulatorTestParam, CorrectResult)
//{
// SUCCEED();
//}
//
//INSTANTIATE_TEST_CASE_P ( ARTSimulator, SimulatorTestParam,
// testing::Combine ( testing::Values ( SimulatorParam::SceneParam { "",
// VistaVector3D ( 1,1.5,1 ), // source
// VistaVector3D( -0.5,1.5,-0.5 ) // receiver
// } ),
// testing::Values ( SimulatorParam::MiscParam { 1, 0.01, 0.9, true },
// SimulatorParam::MiscParam { 1, 0.01, 0.9, true },
// SimulatorParam::MiscParam { 1, 6.0, 0.15, true } ) ) );
......@@ -36,8 +36,7 @@ if( ITA_SIMULATION_SCHEDULER_RAVEN_MODULE )
)
endif ( )
if( ITA_SIMULATION_SCHEDULER_ART_MODULE )
list( APPEND ProjectSources
)
include( "ART/_SourceFiles.cmake" )
endif ( )
add_executable( all_tests ${ProjectSources} )
......
Markdown is supported
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