diff --git a/src/Ryujinx.Tests/MatrixTheoryData.cs b/src/Ryujinx.Tests/MatrixTheoryData.cs deleted file mode 100644 index 12e85f845..000000000 --- a/src/Ryujinx.Tests/MatrixTheoryData.cs +++ /dev/null @@ -1,340 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; -using Xunit; - -namespace Ryujinx.Tests -{ - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - Add(t1, t2, t3); - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - Add(t1, t2, t3, t4); - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - Add(t1, t2, t3, t4, t5); - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - Add(t1, t2, t3, t4, t5, t6); - } - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6, IEnumerable data7) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - Contract.Assert(data7 != null && data7.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - foreach (T7 t7 in data7) - { - Add(t1, t2, t3, t4, t5, t6, t7); - } - } - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6, IEnumerable data7, IEnumerable data8) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - Contract.Assert(data7 != null && data7.Any()); - Contract.Assert(data8 != null && data8.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - foreach (T7 t7 in data7) - { - foreach (T8 t8 in data8) - { - Add(t1, t2, t3, t4, t5, t6, t7, t8); - } - } - } - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6, IEnumerable data7, IEnumerable data8, IEnumerable data9) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - Contract.Assert(data7 != null && data7.Any()); - Contract.Assert(data8 != null && data8.Any()); - Contract.Assert(data9 != null && data9.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - foreach (T7 t7 in data7) - { - foreach (T8 t8 in data8) - { - foreach (T9 t9 in data9) - { - Add(t1, t2, t3, t4, t5, t6, t7, t8, t9); - } - } - } - } - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6, IEnumerable data7, IEnumerable data8, IEnumerable data9, IEnumerable data10) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - Contract.Assert(data7 != null && data7.Any()); - Contract.Assert(data8 != null && data8.Any()); - Contract.Assert(data9 != null && data9.Any()); - Contract.Assert(data10 != null && data10.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - foreach (T7 t7 in data7) - { - foreach (T8 t8 in data8) - { - foreach (T9 t9 in data9) - { - foreach (T10 t10 in data10) - { - Add(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); - } - } - } - } - } - } - } - } - } - } - } - } - - public class MatrixTheoryData : TheoryData - { - public MatrixTheoryData(IEnumerable data1, IEnumerable data2, IEnumerable data3, IEnumerable data4, IEnumerable data5, IEnumerable data6, IEnumerable data7, IEnumerable data8, IEnumerable data9, IEnumerable data10, IEnumerable data11) - { - Contract.Assert(data1 != null && data1.Any()); - Contract.Assert(data2 != null && data2.Any()); - Contract.Assert(data3 != null && data3.Any()); - Contract.Assert(data4 != null && data4.Any()); - Contract.Assert(data5 != null && data5.Any()); - Contract.Assert(data6 != null && data6.Any()); - Contract.Assert(data7 != null && data7.Any()); - Contract.Assert(data8 != null && data8.Any()); - Contract.Assert(data9 != null && data9.Any()); - Contract.Assert(data10 != null && data10.Any()); - Contract.Assert(data11 != null && data11.Any()); - - foreach (T1 t1 in data1) - { - foreach (T2 t2 in data2) - { - foreach (T3 t3 in data3) - { - foreach (T4 t4 in data4) - { - foreach (T5 t5 in data5) - { - foreach (T6 t6 in data6) - { - foreach (T7 t7 in data7) - { - foreach (T8 t8 in data8) - { - foreach (T9 t9 in data9) - { - foreach (T10 t10 in data10) - { - foreach (T11 t11 in data11) - { - AddRow(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); - } - } - } - } - } - } - } - } - } - } - } - } - } -} diff --git a/src/Ryujinx.Tests/RandomUtils.cs b/src/Ryujinx.Tests/RandomUtils.cs deleted file mode 100644 index 2f9b30442..000000000 --- a/src/Ryujinx.Tests/RandomUtils.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Ryujinx.Tests -{ - public static class RandomUtils - { - public static bool NextBool(this Random random) - { - return random.Next(2) == 1; - } - - public static uint NextUShort(this Random random) - { - return (uint)random.Next(ushort.MaxValue); - } - - public static uint NextUInt(this Random random) - { - return (uint)random.NextInt64(uint.MaxValue); - } - - public static uint NextUInt(this Random random, uint to) - { - return (uint)random.NextInt64(to); - } - - public static ulong NextULong(this Random random) - { - byte[] buffer = new byte[8]; - - random.NextBytes(buffer); - return BitConverter.ToUInt64(buffer); - } - - public static byte NextByte(this Random random, byte from, byte to) - { - return (byte)random.Next(from, to); - } - - public static IEnumerable NextUIntEnumerable(this Random random, int count) - { - List list = new(); - - for (int i = 0; i < count; i++) - { - list.Add(random.NextUInt()); - } - - return list.AsReadOnly(); - } - } -} diff --git a/src/Ryujinx.Tests/RangeTheoryData.cs b/src/Ryujinx.Tests/RangeTheoryData.cs deleted file mode 100644 index d07883a74..000000000 --- a/src/Ryujinx.Tests/RangeTheoryData.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Numerics; -using Xunit; - -namespace Ryujinx.Tests -{ - public class RangeTheoryData : TheoryData where T : INumber - { - public RangeTheoryData(T from, T to, T step) - { - for (T i = from; i <= to; i += step) - { - Add(i); - } - } - } -} diff --git a/src/Ryujinx.Tests/RangeUtils.cs b/src/Ryujinx.Tests/RangeUtils.cs deleted file mode 100644 index 0e415ab38..000000000 --- a/src/Ryujinx.Tests/RangeUtils.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using System.Numerics; - -namespace Ryujinx.Tests -{ - public static class RangeUtils - { - public static List RangeData(T from, T to, T step) where T : INumber - { - List data = new(); - - for (T i = from; i <= to; i += step) - { - data.Add(i); - } - - return data; - } - } -} diff --git a/src/Ryujinx.Tests/StaticTheoryData.cs b/src/Ryujinx.Tests/StaticTheoryData.cs deleted file mode 100644 index b38d3dc88..000000000 --- a/src/Ryujinx.Tests/StaticTheoryData.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Xunit; - -namespace Ryujinx.Tests -{ - public class StaticTheoryData : TheoryData - { - public StaticTheoryData(params object[] data) - { - List indices = new(); - int length = -1; - - for (int i = 0; i < data.Length; i++) - { - if (data[i] is IList { Count: > 0 } list) - { - indices.Add(i); - - if (length == -1) - { - length = list.Count; - } - else if (length != list.Count) - { - throw new NotImplementedException($"{nameof(StaticTheoryData)} currently only works with lists of the same size. (expected: {length}, actual: {list.Count})"); - } - } - } - - if (indices.Count == 0) - { - AddRow(data); - return; - } - - for (int i = 0; i < length; i++) - { - object[] row = new object[data.Length]; - - for (int j = 0; j < data.Length; j++) - { - if (indices.Contains(j) && data[j] is IList list) - { - row[j] = list[i]; - } - else - { - row[j] = data[j]; - } - } - - AddRow(row); - } - } - } -}