浏览代码

Revived samples in range test for animation curve sampler

/main
Mohsen Kamalzadeh 4 年前
当前提交
354b49f0
共有 1 个文件被更改,包括 20 次插入0 次删除
  1. 20
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/AnimationCurveSamplerTests.cs

20
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/AnimationCurveSamplerTests.cs


{
m_BaseSampler = new AnimationCurveSampler();
}
[Test]
public void SamplesInRange()
{
var min = m_Sampler.distributionCurve.keys[0].time;
var max = m_Sampler.distributionCurve.keys[m_Sampler.distributionCurve.length - 1].time;
var samples = new float[k_TestSampleCount];
for (var i = 0; i < samples.Length; i++)
{
samples[i] = m_Sampler.Sample();
}
Assert.AreEqual(samples.Length, k_TestSampleCount);
for (var i = 0; i < samples.Length; i++)
{
Assert.GreaterOrEqual(samples[i], min);
Assert.LessOrEqual(samples[i], max);
}
}
}
}
正在加载...
取消
保存