github-actions[bot] commented on code in PR #25656: URL: https://github.com/apache/doris/pull/25656#discussion_r1366372757
########## be/test/olap/version_graph_test.cpp: ########## @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/version_graph.h" + +#include <gmock/gmock-actions.h> +#include <gmock/gmock-matchers.h> +#include <gtest/gtest-message.h> +#include <gtest/gtest-test-part.h> + +#include <filesystem> + +#include "common/status.h" +#include "gtest/gtest_pred_impl.h" +#include "testutil/test_util.h" + +using ::testing::_; +using ::testing::Return; +using ::testing::SetArgPointee; +using std::string; + +namespace doris { + +class VersionGraphTest : public testing::Test { +public: + virtual void SetUp() {} + + virtual void TearDown() {} +}; + +TEST_F(VersionGraphTest, consistency_version) { Review Comment: warning: all parameters should be named in a function [readability-named-parameter] ```suggestion TEST_F(VersionGraphTest /*unused*/, consistency_version /*unused*/) { ``` ########## be/test/olap/version_graph_test.cpp: ########## @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/version_graph.h" Review Comment: warning: 'olap/version_graph.h' file not found [clang-diagnostic-error] ```cpp #include "olap/version_graph.h" ^ ``` ########## be/src/olap/version_graph.cpp: ########## @@ -218,7 +218,7 @@ bool TimestampedVersionTracker::_find_path_from_stale_map( return false; } -void TimestampedVersionTracker::get_stale_version_path_json_doc(rapidjson::Document& path_arr) { +void TimestampedVersionTracker::get_stale_version_path_json_doc(rapidjson::Document& path_arr) const { Review Comment: warning: method 'get_stale_version_path_json_doc' can be made static [readability-convert-member-functions-to-static] ```suggestion static void TimestampedVersionTracker::get_stale_version_path_json_doc(rapidjson::Document& path_arr) { ``` ########## be/test/olap/version_graph_test.cpp: ########## @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/version_graph.h" + +#include <gmock/gmock-actions.h> +#include <gmock/gmock-matchers.h> +#include <gtest/gtest-message.h> +#include <gtest/gtest-test-part.h> + +#include <filesystem> + +#include "common/status.h" +#include "gtest/gtest_pred_impl.h" +#include "testutil/test_util.h" + +using ::testing::_; +using ::testing::Return; +using ::testing::SetArgPointee; +using std::string; + +namespace doris { + +class VersionGraphTest : public testing::Test { +public: + virtual void SetUp() {} + + virtual void TearDown() {} +}; + +TEST_F(VersionGraphTest, consistency_version) { + TimestampedVersionTracker version_tracker; + Version version(0, 1); + version_tracker.add_version(version); + for (int i = 1; i <= 518; i++) { Review Comment: warning: 518 is a magic number; consider replacing it with a named constant [readability-magic-numbers] ```cpp for (int i = 1; i <= 518; i++) { ^ ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
