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

Function TEST

src/test/common/test_pretty_binary.cc:8–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "gtest/gtest.h"
7
8TEST(pretty_binary, print) {
9 ASSERT_EQ(pretty_binary_string(std::string("foo\001\002bars")), std::string("'foo'0x0102'bars'"));
10 ASSERT_EQ(pretty_binary_string(std::string("foo''bars")), std::string("'foo''''bars'"));
11 ASSERT_EQ(pretty_binary_string(std::string("foo\377 \200!!")), std::string("'foo'0xFF2020802121"));
12 ASSERT_EQ(pretty_binary_string(std::string("\001\002\003\004")), std::string("0x01020304"));
13}
14
15TEST(pretty_binary, unprint) {
16 ASSERT_EQ(pretty_binary_string_reverse(std::string("'foo'0x0102'bars'")), std::string("foo\001\002bars"));

Callers

nothing calls this directly

Calls 3

pretty_binary_stringFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected