MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / TEST

Function TEST

FileFilterTest/RelocationsExtractorTest.cpp:101–119  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 5

GetDumpBinPathFunction · 0.85
ExtractBaseAddressFunction · 0.85
ExtractMethod · 0.80
ExtractRelocationsFunction · 0.70
GetOutputBinaryPathFunction · 0.50

Tested by

no test coverage detected