github-actions[bot] commented on code in PR #15298: URL: https://github.com/apache/doris/pull/15298#discussion_r1056004413
########## be/test/exprs/timestamp_functions_test.cpp: ########## @@ -41,19 +40,11 @@ class TimestampFunctionsTest : public testing::Test { TimestampFunctionsTest() {} void SetUp() { - TQueryGlobals globals; - globals.__set_now_string("2019-08-06 01:38:57"); - globals.__set_timestamp_ms(1565080737805); - globals.__set_time_zone("America/Los_Angeles"); - state = new RuntimeState(globals); - utils = new FunctionUtils(state); + utils = new FunctionUtils(); ctx = utils->get_fn_ctx(); } - void TearDown() { - delete state; - delete utils; - } + void TearDown() { delete utils; } Review Comment: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override] ```suggestion void TearDown() override { delete utils; } ``` ########## be/test/exprs/timestamp_functions_test.cpp: ########## @@ -354,9 +345,9 @@ DateTimeVal dt_val; dt_val.packed_time = 1847544683002068992; dt_val.type = TIME_DATETIME; - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, dt_val).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, StringVal("2019-08-06 01:38:57"), + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx).val); + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx, dt_val).val); + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx, StringVal("2019-08-06 01:38:57"), Review Comment: warning: 'ctx' is a private member of 'doris::TimestampFunctionsTest' [clang-diagnostic-error] ```cpp EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx, StringVal("2019-08-06 01:38:57"), ^ ``` **be/test/exprs/timestamp_functions_test.cpp:51:** declared private here ```cpp FunctionContext* ctx = nullptr; ^ ``` ########## be/test/exprs/timestamp_functions_test.cpp: ########## @@ -354,9 +345,9 @@ DateTimeVal dt_val; dt_val.packed_time = 1847544683002068992; dt_val.type = TIME_DATETIME; - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, dt_val).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, StringVal("2019-08-06 01:38:57"), + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx).val); + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx, dt_val).val); Review Comment: warning: 'ctx' is a private member of 'doris::TimestampFunctionsTest' [clang-diagnostic-error] ```cpp EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx, dt_val).val); ^ ``` **be/test/exprs/timestamp_functions_test.cpp:51:** declared private here ```cpp FunctionContext* ctx = nullptr; ^ ``` ########## be/test/exprs/timestamp_functions_test.cpp: ########## @@ -354,9 +345,9 @@ DateTimeVal dt_val; dt_val.packed_time = 1847544683002068992; dt_val.type = TIME_DATETIME; - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, dt_val).val); - EXPECT_EQ(1565080737, TimestampFunctions::to_unix(ctx, StringVal("2019-08-06 01:38:57"), + EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx).val); Review Comment: warning: 'ctx' is a private member of 'doris::TimestampFunctionsTest' [clang-diagnostic-error] ```cpp EXPECT_EQ(1565026737, TimestampFunctions::to_unix(ctx).val); ^ ``` **be/test/exprs/timestamp_functions_test.cpp:51:** declared private here ```cpp FunctionContext* ctx = nullptr; ^ ``` ########## be/test/exprs/timestamp_functions_test.cpp: ########## @@ -341,7 +332,7 @@ } TEST_F(TimestampFunctionsTest, from_unix) { - IntVal unixtimestamp(1565080737); + IntVal unixtimestamp(1565026737); StringVal sval = TimestampFunctions::from_unix(ctx, unixtimestamp); Review Comment: warning: 'ctx' is a private member of 'doris::TimestampFunctionsTest' [clang-diagnostic-error] ```cpp StringVal sval = TimestampFunctions::from_unix(ctx, unixtimestamp); ^ ``` **be/test/exprs/timestamp_functions_test.cpp:51:** declared private here ```cpp FunctionContext* ctx = nullptr; ^ ``` -- 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