MCPcopy Create free account
hub / github.com/apache/impala / TEST

Function TEST

be/src/util/error-util-test.cc:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30constexpr int ErrorMsg::MAX_ERROR_MESSAGE_LEN;
31
32TEST(ErrorMsg, GenericFormatting) {
33 ErrorMsg msg(TErrorCode::GENERAL, "This is a test");
34 ASSERT_EQ("This is a test", msg.msg());
35
36 msg.AddDetail("Detail come here.");
37 msg.AddDetail("Or here.");
38 ASSERT_EQ("This is a test\nDetail come here.\nOr here.\n",
39 msg.GetFullMessageDetails());
40
41 msg = ErrorMsg(TErrorCode::MISSING_BUILTIN, "fun", "sym");
42 ASSERT_EQ("Builtin 'fun' with symbol 'sym' does not exist. Verify that "
43 "all your impalads are the same version.", msg.msg());
44
45 // Test long error message and truncation.
46 string long_msg = std::string(256 * 1024, '-'); // 256kb string
47 msg = ErrorMsg(TErrorCode::GENERAL, long_msg);
48 ASSERT_EQ(ErrorMsg::MAX_ERROR_MESSAGE_LEN, msg.msg().size());
49}
50
51TEST(ErrorMsg, MergeMap) {
52 ErrorLogMap left, right;

Callers

nothing calls this directly

Calls 10

ErrorMsgClass · 0.85
MergeErrorMapsFunction · 0.85
ClearErrorMapFunction · 0.85
ErrorCountFunction · 0.85
AppendErrorFunction · 0.85
PrintErrorMapToStringFunction · 0.85
GetFullMessageDetailsMethod · 0.80
AddDetailMethod · 0.45
sizeMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected