You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
884 B
34 lines
884 B
using NUnit.Framework;
|
|
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.Rendering.TestFramework
|
|
{
|
|
static class AssertUtilities
|
|
{
|
|
const float Epsilon = 1e-6f;
|
|
|
|
public static void AssertAreEqual(Vector3 l, Vector3 r)
|
|
{
|
|
Assert.True(
|
|
Mathf.Abs(l.x - r.x) < Epsilon
|
|
&& Mathf.Abs(l.y - r.y) < Epsilon
|
|
&& Mathf.Abs(l.z - r.z) < Epsilon
|
|
);
|
|
}
|
|
|
|
public static void AssertAreEqual(Quaternion l, Quaternion r)
|
|
{
|
|
AssertAreEqual(l.eulerAngles, r.eulerAngles);
|
|
}
|
|
|
|
public static void AssertAreEqual(Matrix4x4 l, Matrix4x4 r)
|
|
{
|
|
for (int y = 0; y < 4; ++y)
|
|
{
|
|
for (int x = 0; x < 4; ++x)
|
|
Assert.True(Mathf.Abs(l[x, y] - r[x, y]) < Epsilon);
|
|
}
|
|
}
|
|
}
|
|
}
|