-------------------------------------------------------------------------
| 99 | |
| 100 | //------------------------------------------------------------------------- |
| 101 | TEST(RelocationsExtractorTest, Extract) |
| 102 | { |
| 103 | FileFilter::RelocationsExtractor extractor; |
| 104 | |
| 105 | auto hProcess = GetCurrentProcess(); |
| 106 | auto hModule = GetModuleHandle(TestCoverageOptimizedBuild::GetOutputBinaryPath().c_str()); |
| 107 | auto baseOfImage = reinterpret_cast<DWORD64>(hModule); |
| 108 | ASSERT_NE(0, baseOfImage); |
| 109 | |
| 110 | auto dumpBinPath = GetDumpBinPath(); |
| 111 | auto baseAddress = ExtractBaseAddress(dumpBinPath); |
| 112 | auto relocations = extractor.Extract(hProcess, baseOfImage); |
| 113 | |
| 114 | std::unordered_set<DWORD64> relocationsWithBaseAddress; |
| 115 | for (auto relocation : relocations) |
| 116 | relocationsWithBaseAddress.insert(relocation + baseAddress); |
| 117 | auto expectedRelocations = ExtractRelocations(dumpBinPath); |
| 118 | ASSERT_EQ(relocationsWithBaseAddress, expectedRelocations); |
| 119 | } |
| 120 | } |
nothing calls this directly
no test coverage detected