2024-03-19 16:29:42 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
#include <vector>
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
#define TEST_VERIFY(a) \
|
|
|
|
if(!(a)) \
|
|
|
|
{ \
|
|
|
|
printf("Verification failed: '%s'. Aborting.\n", #a); \
|
|
|
|
std::abort(); \
|
|
|
|
}
|
|
|
|
|
2024-03-21 14:24:08 -04:00
|
|
|
class CMemoryViewModelTests
|
2024-03-19 16:29:42 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
void RunTests();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8 GetByte(uint32);
|
|
|
|
|
|
|
|
void TestSimpleBytes();
|
|
|
|
void TestOutOfBounds();
|
2024-03-20 15:25:42 -04:00
|
|
|
void TestWindowOutOfBounds();
|
2024-03-19 16:29:42 -04:00
|
|
|
void TestAddressToModelIndex();
|
|
|
|
void TestAddressToModelIndexWord();
|
2024-03-20 15:25:42 -04:00
|
|
|
void TestAddressToModelIndexWindowed();
|
2024-03-19 16:29:42 -04:00
|
|
|
void TestModelIndexToAddress();
|
|
|
|
void TestModelIndexToAddressWord();
|
|
|
|
|
|
|
|
std::function<uint8(uint32)> m_getByteFunction;
|
|
|
|
std::vector<uint8> m_memory;
|
|
|
|
};
|