4#include "cdm/utils/testing/SETestManager.h"
5#include "engine/human_adult/whole_body/Engine.h"
6#include "engine/human_adult/whole_body/controller/Controller.h"
12namespace pulse {
namespace human_adult_whole_body
17 EngineTest(
Logger* logger =
nullptr);
18 virtual ~EngineTest();
20 virtual bool RunTest(
const std::string& testName,
const std::string& sOutputDirectory)
override;
23 virtual void FillFunctionMap()
override;
24 typedef void(EngineTest::* testFunction)(
const std::string&);
25 std::map<std::string, testFunction> testMap;
26 std::stringstream m_ss;
37 void CardiovascularCircuitAndTransportTest(
const std::string& sTestDirectory);
38 void CardiovascularAndRenalCircuitAndTransportTest(
const std::string& sTestDirectory);
39 void CardiovascularAndTissueCircuitAndTransportTest(
const std::string& sTestDirectory);
40 void CardiovascularAndCerebrospinalFluidCircuitAndTransportTest(
const std::string& sTestDirectory);
41 void FullCardiovascularCircuitAndTransportTest(
const std::string& sTestDirectory);
42 void CardiovascularBloodGasesTest(
const std::string& sTestDirectory);
43 void TuneCardiovascularCircuitTest(
const std::string& sTestDirectory);
45 void CardiovascularCircuitScaleTests(
const std::string& sTestDirectory);
47 enum CardiovascularDriver { Sinusoid = 0, Heart };
48 void SinusoidHeartDriver(
double time_s,
double heartRate_s,
double& lHeartElastance,
double& rHeartElastance);
49 void CardiovascularCircuitAndTransportTest(CardiovascularDriver driverType,
double complianceScale,
double resistanceScale,
double volumeScale,
double heartRate_bpm,
50 double sysRes,
double sysComp,
double aortaRes,
double aortaComp,
double rightHeartRes,
double venaCavaComp,
bool connectTissue,
bool connectRenal,
bool connectCSF,
51 bool balanceBloodgases,
const std::string& sTestDirectory,
const std::string& sTestName,
bool breakOutResults);
52 void TuneCardiovascularCircuitTest(
SETestSuite& testSuite,
const std::string& sTestDirectory,
const std::string& sTestName,
SEPatient& patient);
54 double m_MeanAortaPressure;
55 double m_MeanCVPressure;
59 double m_CardiacOutput;
65 void RenalCircuitAndTransportTest(
const std::string& sTestDirectory);
66 void RenalTGFFeedbackTest(
const std::string& sTestDirectory);
67 void RenalTGFandUPRFeedbackTest(
const std::string& sTestDirectory);
68 void RenalSecretionTest(
const std::string& sTestDirectory);
69 void RenalUrinateTest(
const std::string& sTestDirectory);
71 enum RenalFeedback { TGF, TGFandUPR };
72 void RenalFeedbackTest(RenalFeedback feedback,
const std::string& sTestDirectory,
const std::string& sTestName);
73 enum RenalSystems { Secretion, Urinating};
74 void RenalSystemTest(RenalSystems systemtest,
const std::string& sTestDirectory,
const std::string& sTestName);
80 void RespiratoryCircuitAndTransportTest(
const std::string& sTestDirectory);
81 void RespiratoryDriverTest(
const std::string& sTestDirectory);
83 enum RespiratoryConfiguration { RespiratorySolo, AnesthesiaMachineSolo, RespiratoryWithAnesthesiaMachine, RespiratoryWithInhaler, RespiratoryWithMechanicalVentilation, MechanicalVentilatorSolo, RespiratoryWithMechanicalVentilator
85 void RespiratoryCircuitAndTransportTest(RespiratoryConfiguration config,
const std::string& sTestDirectory);
91 void AnesthesiaMachineCircuitAndTransportTest(
const std::string& sTestDirectory);
92 void RespiratoryWithAnesthesiaMachineCircuitAndTransportTest(
const std::string& sTestDirectory);
94 void AnesthesiaMachineCircuitAndTransportTest(RespiratoryConfiguration config,
const std::string& sTestDirectory);
100 void MechanicalVentilatorCircuitAndTransportTest(
const std::string& sTestDirectory);
101 void RespiratoryWithMechanicalVentilatorCircuitAndTransportTest(
const std::string& sTestDirectory);
103 void MechanicalVentilatorCircuitAndTransportTest(RespiratoryConfiguration config,
const std::string& sTestDirectory);
109 void RespiratoryWithInhalerCircuitAndTransportTest(
const std::string& sTestDirectory);
116 void RespiratoryWithMechanicalVentilationCircuitAndTransportTest(
const std::string& sTestDirectory);
122 void InternalTemperatureVariableBMRCircuitTest(
const std::string& sTestDirectory);
123 void InternalTemperatureVariableSkinCircuitTest(
const std::string& sTestDirectory);
124 void InternalTemperatureVariableCoreCircuitTest(
const std::string& sTestDirectory);
125 void EnvironmentVariableTemperatureCircuitTest(
const std::string& sTestDirectory);
126 void CombinedInternalAndEnvironmentVariableBMRandTemperatureCircuitTest(
const std::string& sTestDirectory);
127 void CombinedInternalAndEnvironmentSkinTempDropCircuitTest(
const std::string& sTestDirectory);
128 void EnvironmentISO7730ComparisonTest(
const std::string& sTestDirectory);
135 void DiffusionClearanceExcretionTests(
const std::string& rptDirectory);
136 void AlveolarCarbonDioxideDiffusionTest(
const std::string& rptDirectory);
137 void AlveolarOxygenDiffusionTest(
const std::string& rptDirectory);
138 void InstantPlusSimpleDiffusionTest(
const std::string& rptDirectory);
139 void SimpleDiffusionTwoCompartmentTest(
const std::string& rptDirectory);
140 void SimpleDiffusionFourCompartmentTest(
const std::string& rptDirectory);
141 void SimpleDiffusionHierarchyTest(
const std::string& rptDirectory);
142 void FacilitatedDiffusionTest(
const std::string& rptDirectory);
145 void PerfusionLimitedDiffusionTest(
SETestSuite& testSuite);
155 void BrainInjuryTest(
const std::string& rptDirectory);
162 void FourCompartmentTestSimple(
const std::string& sOutputDirectory);
163 void AcidBaseFourCompartmentTest(
const std::string& sOutputDirectory);
164 void FiveCompartmentTestWithDiffusion(
const std::string& sOutputDirectory);
165 void AcidBaseFourCompartmentTestWithProductionConsumption(
const std::string& sOutputDirectory);
166 void AcidBaseFiveCompartmentTestWithDiffusion(
const std::string& sOutputDirectory);
167 void AcidBaseFiveCompartmentTestWithProductionConsumptionAndDiffusion(
const std::string& sOutputDirectory);
169 void FourCompartmentTest(
bool usingAcidBase,
bool usingProductionConsumption,
bool usingDiffusion,
const std::string& sOutputDirectory);
171 bool usingProductionConsumption;
178 void AcidBaseMathTest(
const std::string& sOutputDirectory);
179 void AcidBaseFeedbackTest(
const std::string& sOutputDirectory);
180 void AcidBaseLimitsTest(
const std::string& sOutputDirectory);
181 void AcidBaseExtremeTest(
const std::string & rptDirectory);
182 void AcidBaseBloodGasTests(
const std::string& sOutputDirectory);
184 enum bloodType { ARTERIAL, VENOUS, CAPILLARY, RESPIRATORY_ACIDOSIS, METABOLIC_ALKALOSIS, METABOLIC_ACIDOSIS, RESPIRATORY_ALKALOSIS, CUSTOM };
185 void AcidBaseBloodGasTest(Controller& bg, bloodType compartment,
SETestSuite& testSuite);
191 void AerosolTest(
const std::string& sOutputDirectory);
193 void SizeIndependentDepositionEfficencyCoefficientsTest(
SETestSuite& suite,
SESubstance& substance,
double expectedMouthCoeff,
double expectedCarinaCoeff,
double expectedDeadSpaceCoeff,
double expectedAlveoliCoeff);
194 void DepositionFractionTest(
SETestSuite& suite,
SESubstance& substance,
double expectedMouthDepFrac,
double expectedCarinaDepFrac,
195 double expectedLeftDeadSpaceDepFrac,
double expectedLeftAlveoliDepFrac,
double expectedRightDeadSpaceDepFrac,
double expectedRightAlveoliDepFrac);
201 void ReadScenarios(
const std::string& sOutputDirectory);
202 void ReuseEngine(
const std::string& sOutputDirectory);
203 void SerializationTest(
const std::string& sTestDirectory);
204 void SetupPatientTest(
const std::string& sTestDirectory);
206 void ConditionCombinations(
const std::string& rptDirectory);
207 void SolverSpeedTest(
const std::string& sTestDirectory);
213 void SetupPatient(
SETestSuite& testSuite,
const std::string& sTestDirectory,
const std::string& sTestName,
SEPatient* patient,
SEPatient* expectedPatient,
bool expectedPass);
214 bool CheckSetupPatient(
SEPatient& setupPatient,
SEPatient& expectedPatient, std::vector<std::string>& errs);
219 void EmptyBlackBoxTest(
const std::string& sOutputDirectory);
220 void ImposeFlowBlackBoxTest(
const std::string& sOutputDirectory);
221 void ImposePressureAndFlowBlackBoxTest(
const std::string& sOutputDirectory);
Definition: SerializationTest.cpp:46
Definition: PhysiologyEngine.h:68
Definition: SEPatient.h:13
Definition: SESubstance.h:15
Definition: SETestManager.h:8
Definition: SETestSuite.h:10