浏览代码

[shadergen] minor test cleanup

/main
vlad-andreev 8 年前
当前提交
399968a2
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 24
      Assets/Editor/Tests/ShaderGeneratorTests/ShaderGeneratorTests.cs

24
Assets/Editor/Tests/ShaderGeneratorTests/ShaderGeneratorTests.cs


return foundError;
}
[Test]
public void Fail_NestedWithNonPrimitiveType()
[Test(Description = "Disallow non-primitive types in nested structs")]
public void Fail_NestedWithNonPrimitiveType()
{
string source;
List<string> errors;

Assert.IsTrue(HasErrorString(errors, "contains a non-primitive field type"));
}
[Test]
public void Fail_UnsupportedPrimitiveType()
[Test(Description = "Check for unsupported types in primitive structs")]
public void Fail_UnsupportedPrimitiveType()
{
string source;
List<string> errors;

Assert.IsTrue(HasErrorString(errors, "contains an unsupported field type"));
}
[Test]
[Test(Description = "Disallow mixed types in nested structs")]
public void Fail_MixedTypesInNestedStruct()
{
string source;

Assert.IsTrue(HasErrorString(errors, "contains mixed basic types"));
}
[Test]
public void Fail_TooManyFields()
[Test(Description = "Disallow more than 16 bytes worth of fields in nested structs")]
public void Fail_TooManyFields()
bool success = CSharpToHLSL.GenerateHLSL(typeof(FailureTypes.TooManyFields), new GenerateHLSL(PackingRules.Aggressive), out source, out errors);
bool success = CSharpToHLSL.GenerateHLSL(typeof(FailureTypes.TooManyFields), new GenerateHLSL(PackingRules.Exact), out source, out errors);
[Test]
public void Fail_MergeIncompatibleTypes()
[Test(Description = "Disallow merging incompatible types when doing aggressive packing")]
public void Fail_MergeIncompatibleTypes()
{
string source;
List<string> errors;

Assert.IsTrue(HasErrorString(errors, "incompatible types"));
}
[Test]
public void Fail_MergeCrossBoundary()
[Test(Description = "Disallow placing fields across register boundaries when merging")]
public void Fail_MergeCrossBoundary()
{
string source;
List<string> errors;

正在加载...
取消
保存