MCPcopy Create free account
hub / github.com/apache/brpc / CheckDebugOutputToStream

Function CheckDebugOutputToStream

test/stack_trace_unittest.cc:135–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void CheckDebugOutputToStream(bool exclude_self) {
136 StackTrace trace(exclude_self);
137 size_t count;
138 const void* const* addrs = trace.Addresses(&count);
139 ASSERT_EQ(count, trace.FrameCount());
140 void* addr = malloc(sizeof(void*) * count);
141 size_t copied_count = trace.CopyAddressTo((void**)addr, count);
142 ASSERT_EQ(count, copied_count);
143 ASSERT_EQ(0, memcmp(addrs, addr, sizeof(void*) * count));
144
145 std::ostringstream os;
146 trace.OutputToStream(&os);
147 VLOG(1) << os.str();
148 free(addr);
149}
150
151// The test is used for manual testing, e.g., to see the raw output.
152TEST_F(StackTraceTest, DebugOutputToStream) {

Callers 1

TEST_FFunction · 0.85

Calls 3

AddressesMethod · 0.80
CopyAddressToMethod · 0.80
OutputToStreamMethod · 0.45

Tested by

no test coverage detected