浏览代码

added sampler utility test

/main
Steven Leal 4 年前
当前提交
92fabc1e
共有 2 个文件被更改,包括 26 次插入0 次删除
  1. 23
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs
  2. 3
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs.meta

23
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs


using NUnit.Framework;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{
[TestFixture]
public class SamplerUtilityTests
{
[Test]
public void SeedIteratedByChangingEitherBaseSeedOrIndex()
{
// Check if changing the index changes the generated random state
var iteratedIndex1 = SamplerUtility.IterateSeed(0, 0);
var iteratedIndex2 = SamplerUtility.IterateSeed(1, 0);
Assert.AreNotEqual(iteratedIndex1, iteratedIndex2);
// Check if changing the seed changes the generated random state
var iteratedSeed1 = SamplerUtility.IterateSeed(0, 0);
var iteratedSeed2 = SamplerUtility.IterateSeed(0, 1);
Assert.AreNotEqual(iteratedSeed1, iteratedSeed2);
}
}
}

3
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs.meta


fileFormatVersion: 2
guid: b2db5be5ad4544b899d7bed088b7b762
timeCreated: 1597985947
正在加载...
取消
保存