mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-23 10:35:10 +00:00
42 lines
913 B
C#
42 lines
913 B
C#
|
using NUnit.Framework;
|
||
|
using Ryujinx.Memory;
|
||
|
using System;
|
||
|
using System.Runtime.InteropServices;
|
||
|
|
||
|
namespace Ryujinx.Memory.Tests
|
||
|
{
|
||
|
public class Tests
|
||
|
{
|
||
|
private const ulong MemorySize = 0x8000;
|
||
|
|
||
|
private MemoryBlock _memoryBlock;
|
||
|
|
||
|
[SetUp]
|
||
|
public void Setup()
|
||
|
{
|
||
|
_memoryBlock = new MemoryBlock(MemorySize);
|
||
|
}
|
||
|
|
||
|
[TearDown]
|
||
|
public void Teardown()
|
||
|
{
|
||
|
_memoryBlock.Dispose();
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void Test_Read()
|
||
|
{
|
||
|
Marshal.WriteInt32(_memoryBlock.Pointer, 0x2020, 0x1234abcd);
|
||
|
|
||
|
Assert.AreEqual(_memoryBlock.Read<int>(0x2020), 0x1234abcd);
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void Test_Write()
|
||
|
{
|
||
|
_memoryBlock.Write(0x2040, 0xbadc0de);
|
||
|
|
||
|
Assert.AreEqual(Marshal.ReadInt32(_memoryBlock.Pointer, 0x2040), 0xbadc0de);
|
||
|
}
|
||
|
}
|
||
|
}
|