1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System.Diagnostics;
- using UnityEngine.Assertions.Comparers;
- namespace XGame.Framework
- {
- public partial class Assert
- {
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual(float expected, float actual)
- {
- AreEqual(expected, actual, FloatComparer.s_ComparerWithDefaultTolerance, null);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual(float expected, float actual, string format, params object[] args)
- {
- AreEqual(expected, actual, FloatComparer.s_ComparerWithDefaultTolerance, format, args);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual<T>(float expected, float actual, T e) where T : System.Exception
- {
- AreEqual(expected, actual, FloatComparer.s_ComparerWithDefaultTolerance, e);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual(float expected, float actual, float tolerance)
- {
- AreApproximatelyEqual(expected, actual, tolerance, null);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual(float expected, float actual, float tolerance, string format, params object[] args)
- {
- AreEqual(expected, actual, new FloatComparer(tolerance), format, args);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreApproximatelyEqual<T>(float expected, float actual, float tolerance, T e) where T : System.Exception
- {
- AreEqual(expected, actual, new FloatComparer(tolerance), e);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual(float expected, float actual)
- {
- AreNotEqual(expected, actual, null, FloatComparer.s_ComparerWithDefaultTolerance);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual(float expected, float actual, string format, params object[] args)
- {
- AreNotEqual(expected, actual, FloatComparer.s_ComparerWithDefaultTolerance, format, args);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual<T>(float expected, float actual, T e) where T : System.Exception
- {
- AreNotEqual(expected, actual, FloatComparer.s_ComparerWithDefaultTolerance, e);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual(float expected, float actual, float tolerance)
- {
- AreNotApproximatelyEqual(expected, actual, tolerance, null);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual(float expected, float actual, float tolerance, string format, params object[] args)
- {
- AreNotEqual(expected, actual, new FloatComparer(tolerance), format, args);
- }
- [Conditional(MacroDefine.XGAME_ASSERT), Conditional(MacroDefine.UNITY_EDITOR)]
- public static void AreNotApproximatelyEqual<T>(float expected, float actual, float tolerance, T e) where T : System.Exception
- {
- AreNotEqual(expected, actual, new FloatComparer(tolerance), e);
- }
- }
- }
|