mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 18:00:47 -07:00
Ryujinx.Tests: Add unicorn to test framework (#389)
* Ryujinx.Tests: Add unicorn to test framework * CpuTestSimdArithmetic: Comment out inaccurate results
This commit is contained in:
28
Ryujinx.Tests.Unicorn/IndexedProperty.cs
Normal file
28
Ryujinx.Tests.Unicorn/IndexedProperty.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Tests.Unicorn
|
||||
{
|
||||
public class IndexedProperty<TIndex, TValue>
|
||||
{
|
||||
readonly Action<TIndex, TValue> SetAction;
|
||||
readonly Func<TIndex, TValue> GetFunc;
|
||||
|
||||
public IndexedProperty(Func<TIndex, TValue> getFunc, Action<TIndex, TValue> setAction)
|
||||
{
|
||||
this.GetFunc = getFunc;
|
||||
this.SetAction = setAction;
|
||||
}
|
||||
|
||||
public TValue this[TIndex i]
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetFunc(i);
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAction(i, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user