MCPcopy Create free account
hub / github.com/boostorg/stacktrace / test_relative_virtual_address

Function test_relative_virtual_address

test/test.cpp:292–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void test_relative_virtual_address(const char* file_path)
293{
294 const auto frame = to_string(boost::stacktrace::stacktrace(0, 1).as_vector().front());
295
296 // Skip the test if the frame does not contain an address
297 if (frame.find("0x") == std::string::npos) {
298 return;
299 }
300
301 const auto file_size = get_file_size(file_path);
302 BOOST_TEST(file_size > 0);
303
304 const auto address = get_address_from_frame(frame);
305 BOOST_TEST(address > 0);
306
307 // Verify that the address is within the binary
308 BOOST_TEST(address <= file_size);
309}
310
311int main(const int, const char* argv[]) {
312 test_deeply_nested_namespaces();

Callers 1

mainFunction · 0.85

Calls 3

to_stringFunction · 0.85
get_file_sizeFunction · 0.85
get_address_from_frameFunction · 0.85

Tested by

no test coverage detected