浏览代码

updated changelog and fixed tests

/main
Steven Leal 4 年前
当前提交
5b0d6205
共有 3 个文件被更改,包括 22 次插入1 次删除
  1. 8
      com.unity.perception/CHANGELOG.md
  2. 4
      com.unity.perception/Tests/Runtime/Randomization/ParameterTests/StructParameterTests.cs
  3. 11
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerTestsBase.cs

8
com.unity.perception/CHANGELOG.md


### Added
Added ScenarioConstants base class for all scenario constants objects
Unique seeds per Sampler have been replaced with one global random seed configured via the ScenarioConstants of a Scenario
Replaced ScenarioBase.GenerateRandomSeed() with ScenarioBase.NextRandomSeed()
Removed ScenarioBase.GenerateRandomSeedFromIndex()
### Fixed

4
com.unity.perception/Tests/Runtime/Randomization/ParameterTests/StructParameterTests.cs


using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using Object = UnityEngine.Object;
namespace RandomizationTests.ParameterTests

public void Setup()
{
m_TestObject = new GameObject();
m_TestObject.AddComponent<FixedLengthScenario>();
m_Tests = new BaseStructParameterTest[]
{
new NumericParameterTest<bool>(new BooleanParameter()),

}
[Test]
public void EquivalentManagedAndNativeSamples()
public void CorrectNumberOfNativeSamplesAreGenerated()
{
foreach (var test in m_Tests)
test.GeneratesNativeSamples();

11
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerTestsBase.cs


using System;
using NUnit.Framework;
using Unity.Jobs;
using UnityEngine;
using Object = UnityEngine.Object;
namespace RandomizationTests.SamplerTests
{

protected T m_BaseSampler;
T m_Sampler;
GameObject m_ScenarioObj;
static ScenarioBase activeScenario => ScenarioBase.activeScenario;

m_Sampler = m_BaseSampler;
m_ScenarioObj = new GameObject("Scenario");
m_ScenarioObj.AddComponent<FixedLengthScenario>();
}
[TearDown]
public void TearDown()
{
Object.DestroyImmediate(m_ScenarioObj);
}
[Test]

正在加载...
取消
保存