| 21 | namespace 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 | { |
nothing calls this directly
no test coverage detected