mirror of
https://github.com/dobin/RedEdr
synced 2026-08-09 12:30:51 +00:00
31 lines
728 B
C++
31 lines
728 B
C++
#include "CppUnitTest.h"
|
|
|
|
#include "utils.h"
|
|
|
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
|
|
|
namespace UnitTests
|
|
{
|
|
TEST_CLASS(UnitTests)
|
|
{
|
|
public:
|
|
TEST_METHOD(TestStrA) {
|
|
std::string str = "Hello";
|
|
wchar_t* wstr = string2wcharAlloc(str);
|
|
Assert::AreEqual(L"Hello", wstr);
|
|
}
|
|
|
|
|
|
TEST_METHOD(TestTranslate)
|
|
{
|
|
Assert::AreEqual("--X", getMemoryRegionProtect(0x10));
|
|
Assert::AreEqual("RWX", getMemoryRegionProtect(0x40));
|
|
Assert::AreEqual("EXECUTE_WRITECOPY", getMemoryRegionProtect(0x80));
|
|
|
|
Assert::AreEqual("IMAGE", getMemoryRegionType(0x1000000));
|
|
Assert::AreEqual("MAPPED", getMemoryRegionType(0x40000));
|
|
Assert::AreEqual("PRIVATE", getMemoryRegionType(0x20000));
|
|
}
|
|
};
|
|
}
|