|
|
|
|
|
|
Object.DestroyImmediate(m_TestObject); |
|
|
|
} |
|
|
|
|
|
|
|
void CreateNewScenario() |
|
|
|
// TODO: update this function once the perception camera doesn't skip the first frame
|
|
|
|
IEnumerator CreateNewScenario() |
|
|
|
yield return null; |
|
|
|
CreateNewScenario(); |
|
|
|
yield return CreateNewScenario(); |
|
|
|
m_Scenario.serializedConstantsFileName = "perception_serialization_test"; |
|
|
|
|
|
|
|
var constants = new FixedLengthScenario.Constants |
|
|
|
|
|
|
[UnityTest] |
|
|
|
public IEnumerator IterationsCanLastMultipleFrames() |
|
|
|
{ |
|
|
|
CreateNewScenario(); |
|
|
|
yield return CreateNewScenario(); |
|
|
|
const int testIterationFrameCount = 5; |
|
|
|
m_Scenario.constants.framesPerIteration = testIterationFrameCount; |
|
|
|
|
|
|
|
|
|
|
[UnityTest] |
|
|
|
public IEnumerator FinishesWhenIsScenarioCompleteIsTrue() |
|
|
|
{ |
|
|
|
CreateNewScenario(); |
|
|
|
yield return CreateNewScenario(); |
|
|
|
const int testIterationTotal = 5; |
|
|
|
m_Scenario.constants.framesPerIteration = 1; |
|
|
|
m_Scenario.constants.totalIterations = testIterationTotal; |
|
|
|
|
|
|
[UnityTest] |
|
|
|
public IEnumerator AppliesParametersEveryFrame() |
|
|
|
{ |
|
|
|
CreateNewScenario(); |
|
|
|
yield return CreateNewScenario(); |
|
|
|
m_Scenario.constants.framesPerIteration = 5; |
|
|
|
m_Scenario.constants.totalIterations = 1; |
|
|
|
|
|
|
|
|
|
|
parameter.target.AssignNewTarget( |
|
|
|
m_TestObject, transform, "position", ParameterApplicationFrequency.OnIterationSetup); |
|
|
|
|
|
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
CreateNewScenario(); |
|
|
|
|
|
|
|
yield return CreateNewScenario(); |
|
|
|
m_Scenario.constants.framesPerIteration = 2; |
|
|
|
m_Scenario.constants.totalIterations = 2; |
|
|
|
|
|
|
|
|
|
|
[UnityTest] |
|
|
|
public IEnumerator StartNewDatasetSequenceEveryIteration() |
|
|
|
{ |
|
|
|
CreateNewScenario(); |
|
|
|
yield return CreateNewScenario(); |
|
|
|
m_Scenario.constants.framesPerIteration = 2; |
|
|
|
m_Scenario.constants.totalIterations = 2; |
|
|
|
|
|
|
|