MCPcopy Create free account
hub / github.com/dobin/RedEdr / TEST_CLASS

Function TEST_CLASS

UnitTests/UnitTestProcessInfo.cpp:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace UnitTests
22{
23 TEST_CLASS(MemInfoTest)
24 {
25 public:
26
27 TEST_METHOD(MemInfoBasics)
28 {
29 MemStatic memStatic = MemStatic();
30 MemoryRegion* region = new MemoryRegion("test", 0x1000, 0x1000, "rwx");
31 memStatic.AddMemoryRegion(0x1000, region);
32 Assert::IsTrue(memStatic.ExistMemoryRegion(0x1000));
33 Assert::IsFalse(memStatic.ExistMemoryRegion(0x2000));
34
35 MemoryRegion* region2 = memStatic.GetMemoryRegion(0x1000);
36 Assert::IsNotNull(region2);
37 Assert::AreEqual(region2->name, region->name);
38 Assert::AreEqual(region2->addr, region->addr);
39 Assert::AreEqual(region2->size, region->size);
40 Assert::AreEqual(region2->protection, region->protection);
41
42 memStatic.RemoveMemoryRegion(0x1000, 0x1000);
43 Assert::IsFalse(memStatic.ExistMemoryRegion(0x1000));
44 }
45
46 TEST_METHOD(MemInfoMultiple)
47 {

Callers

nothing calls this directly

Calls 10

MemStaticClass · 0.85
FindProcessIdByNameFunction · 0.85
AddMemoryRegionMethod · 0.80
ExistMemoryRegionMethod · 0.80
GetMemoryRegionMethod · 0.80
RemoveMemoryRegionMethod · 0.80
getObjectMethod · 0.80
containsObjectMethod · 0.80
SetTargetNamesMethod · 0.80

Tested by

no test coverage detected