This is an automated email from the ASF dual-hosted git repository. wangbo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new ef785980720 [Improvement]add tip when check status type failed (#43972) ef785980720 is described below commit ef78598072078eb9659ffbade2ff38f6bb11ce1f Author: wangbo <wan...@selectdb.com> AuthorDate: Fri Nov 15 10:20:29 2024 +0800 [Improvement]add tip when check status type failed (#43972) ### What problem does this PR solve? Add tips when check TStatus failed. ``` ErrorCode::error_states's 47 compare to INVALID_JSON_PATH failed. you need check whether TStatusCode defined in thrift is same with ERROR_CODES in status.h ``` --- be/test/common/status_test.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/be/test/common/status_test.cpp b/be/test/common/status_test.cpp index e5477db1127..f607e56f701 100644 --- a/be/test/common/status_test.cpp +++ b/be/test/common/status_test.cpp @@ -77,8 +77,16 @@ TEST_F(StatusTest, TStatusCodeWithStatus) { continue; } EXPECT_TRUE(tstatus_st.first < ErrorCode::MAX_ERROR_CODE_DEFINE_NUM); - EXPECT_TRUE(ErrorCode::error_states[tstatus_st.first].description.compare( - tstatus_st.second) == 0); + bool ret = ErrorCode::error_states[tstatus_st.first].description.compare( + tstatus_st.second) == 0; + if (!ret) { + std::cout << "ErrorCode::error_states's " << tstatus_st.first << " compare to " + << tstatus_st.second + << " failed. you need check whether TStatusCode defined in thrift " + "is same with ERROR_CODES in status.h" + << std::endl; + } + EXPECT_TRUE(ret); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org