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

Function TEST_F

test/status_unittest.cpp:35–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33};
34
35TEST_F(StatusTest, success_status) {
36 std::ostringstream oss;
37
38 butil::Status st;
39 ASSERT_TRUE(st.ok());
40 ASSERT_EQ(0, st.error_code());
41 ASSERT_STREQ("OK", st.error_cstr());
42 ASSERT_EQ("OK", st.error_str());
43 oss.str("");
44 oss << st;
45 ASSERT_EQ("OK", oss.str());
46
47 butil::Status st2(0, "blahblah");
48 ASSERT_TRUE(st2.ok());
49 ASSERT_EQ(0, st2.error_code());
50 ASSERT_STREQ("OK", st2.error_cstr());
51 ASSERT_EQ("OK", st2.error_str());
52 oss.str("");
53 oss << st2;
54 ASSERT_EQ("OK", oss.str());
55
56 butil::Status st3 = butil::Status::OK();
57 ASSERT_TRUE(st3.ok());
58 ASSERT_EQ(0, st3.error_code());
59 ASSERT_STREQ("OK", st3.error_cstr());
60 ASSERT_EQ("OK", st3.error_str());
61 oss.str("");
62 oss << st3;
63 ASSERT_EQ("OK", oss.str());
64}
65
66#define NO_MEMORY_STR "No memory"
67#define NO_CPU_STR "No CPU"

Callers

nothing calls this directly

Calls 8

okMethod · 0.80
error_cstrMethod · 0.80
set_errorMethod · 0.60
error_codeMethod · 0.45
error_strMethod · 0.45
resetMethod · 0.45
sizeMethod · 0.45
as_stringMethod · 0.45

Tested by

no test coverage detected