From 4ce5e547097595892118df9d55a560a0594df014 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Jul 2023 20:22:28 +0200 Subject: [PATCH] Add MatrixTheoryData util This needs to be changed later. --- src/Ryujinx.Tests/MatrixTheoryData.cs | 340 ++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) create mode 100644 src/Ryujinx.Tests/MatrixTheoryData.cs diff --git a/src/Ryujinx.Tests/MatrixTheoryData.cs b/src/Ryujinx.Tests/MatrixTheoryData.cs new file mode 100644 index 000000000..12e85f845 --- /dev/null +++ b/src/Ryujinx.Tests/MatrixTheoryData.cs @@ -0,0 +1,340 @@ +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); + } + } + } + } + } + } + } + } + } + } + } + } + } +}