github-actions[bot] commented on code in PR #17244: URL: https://github.com/apache/doris/pull/17244#discussion_r1120390623
########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ TEST_F(ConfigTest, UpdateConfigs) { // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); EXPECT_EQ(cfg_double, 654.321); // convert error s = config::set_config("cfg_int32_t", "4294967296124"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '4294967296124' as int32_t failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); EXPECT_EQ(cfg_double, 654.321); // convert error s = config::set_config("cfg_int32_t", "4294967296124"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '4294967296124' as int32_t failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '4294967296124' as int32_t failed") != std::string::npos); EXPECT_EQ(cfg_int32_t, 65536124); // not support s = config::set_config("cfg_std_string", "test"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_IMPLEMENTED_ERROR]'cfg_std_string' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); EXPECT_EQ(cfg_double, 654.321); // convert error s = config::set_config("cfg_int32_t", "4294967296124"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '4294967296124' as int32_t failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '4294967296124' as int32_t failed") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("convert '4294967296124' as int32_t failed") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` ########## be/test/common/config_test.cpp: ########## @@ -99,37 +99,43 @@ // not exist Status s = config::set_config("cfg_not_exist", "123"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_FOUND]'cfg_not_exist' is not found"); + EXPECT_TRUE(s.to_string.find("[NOT_FOUND]") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_not_exist' is not found") != std::string::npos); // immutable EXPECT_TRUE(cfg_bool_immutable); s = config::set_config("cfg_bool_immutable", "false"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), - "[NOT_IMPLEMENTED_ERROR]'cfg_bool_immutable' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_bool_immutable' is not support to modify") != + std::string::npos); EXPECT_TRUE(cfg_bool_immutable); // convert error s = config::set_config("cfg_bool", "falseeee"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert 'falseeee' as bool failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert 'falseeee' as bool failed") != std::string::npos); EXPECT_TRUE(cfg_bool); s = config::set_config("cfg_double", ""); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '' as double failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '' as double failed") != std::string::npos); EXPECT_EQ(cfg_double, 654.321); // convert error s = config::set_config("cfg_int32_t", "4294967296124"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[INVALID_ARGUMENT]convert '4294967296124' as int32_t failed"); + EXPECT_TRUE(s.to_string.find("INVALID_ARGUMENT") != std::string::npos); + EXPECT_TRUE(s.to_string.find("convert '4294967296124' as int32_t failed") != std::string::npos); EXPECT_EQ(cfg_int32_t, 65536124); // not support s = config::set_config("cfg_std_string", "test"); EXPECT_FALSE(s.ok()); - EXPECT_EQ(s.to_string(), "[NOT_IMPLEMENTED_ERROR]'cfg_std_string' is not support to modify"); + EXPECT_TRUE(s.to_string.find("NOT_IMPLEMENTED_ERROR") != std::string::npos); + EXPECT_TRUE(s.to_string.find("'cfg_std_string' is not support to modify") != std::string::npos); Review Comment: warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error] ```cpp EXPECT_TRUE(s.to_string.find("'cfg_std_string' is not support to modify") != std::string::npos); ^ ``` **thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE' ```cpp #define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) ^ ``` **thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE' ```cpp GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ ^ ``` **thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_' ```cpp ::testing::AssertionResult(expression)) \ ^ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org