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

Function TEST

src/test/common/test_str_map.cc:25–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace std;
24
25TEST(str_map, json) {
26 map<string,string> str_map;
27 stringstream ss;
28 // well formatted
29 ASSERT_EQ(0, get_json_str_map("{\"key\": \"value\"}", ss, &str_map));
30 ASSERT_EQ("value", str_map["key"]);
31 // well formatted but not a JSON object
32 ASSERT_EQ(-EINVAL, get_json_str_map("\"key\"", ss, &str_map));
33 ASSERT_NE(string::npos, ss.str().find("must be a JSON object"));
34}
35
36TEST(str_map, plaintext) {
37 {

Callers

nothing calls this directly

Calls 5

get_json_str_mapFunction · 0.85
get_str_mapFunction · 0.85
findMethod · 0.45
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected