/proc/self/cwd/test/test_common/printers.cc
Line | Count | Source (jump to first uncovered line) |
1 | | #include "printers.h" |
2 | | #include "test/test_common/printers.h" |
3 | | |
4 | | #include <iostream> |
5 | | |
6 | | #include "source/common/buffer/buffer_impl.h" |
7 | | #include "source/common/http/header_map_impl.h" |
8 | | |
9 | | namespace Envoy { |
10 | | namespace Http { |
11 | | // NOLINTNEXTLINE(readability-identifier-naming) |
12 | 0 | void PrintTo(const HeaderMapImpl& headers, std::ostream* os) { |
13 | 0 | headers.iterate([os](const HeaderEntry& header) -> HeaderMap::Iterate { |
14 | 0 | *os << "{'" << header.key().getStringView() << "','" << header.value().getStringView() << "'}"; |
15 | 0 | return HeaderMap::Iterate::Continue; |
16 | 0 | }); |
17 | 0 | } |
18 | | |
19 | 0 | void PrintTo(const HeaderMapPtr& headers, std::ostream* os) { |
20 | 0 | PrintTo(*dynamic_cast<HeaderMapImpl*>(headers.get()), os); |
21 | 0 | } |
22 | | |
23 | 0 | void PrintTo(const HeaderMap& headers, std::ostream* os) { |
24 | 0 | PrintTo(*dynamic_cast<const HeaderMapImpl*>(&headers), os); |
25 | 0 | } |
26 | | } // namespace Http |
27 | | |
28 | | namespace Buffer { |
29 | 0 | void PrintTo(const Instance& buffer, std::ostream* os) { |
30 | 0 | *os << "buffer with size=" << buffer.length(); |
31 | 0 | } |
32 | | |
33 | 0 | void PrintTo(const Buffer::OwnedImpl& buffer, std::ostream* os) { |
34 | 0 | PrintTo(dynamic_cast<const Buffer::Instance&>(buffer), os); |
35 | 0 | } |
36 | | } // namespace Buffer |
37 | | |
38 | | namespace Network { |
39 | | namespace Address { |
40 | 0 | void PrintTo(const Instance& address, std::ostream* os) { *os << address.asString(); } |
41 | | } // namespace Address |
42 | | } // namespace Network |
43 | | } // namespace Envoy |