github-actions[bot] commented on code in PR #35639:
URL: https://github.com/apache/doris/pull/35639#discussion_r1619855724


##########
be/src/vec/common/pod_array.h:
##########
@@ -27,7 +27,6 @@
 
 #include <algorithm>
 #include <boost/core/noncopyable.hpp>

Review Comment:
   warning: 'boost/core/noncopyable.hpp' file not found [clang-diagnostic-error]
   ```cpp
   #include <boost/core/noncopyable.hpp>
            ^
   ```
   



##########
be/test/vec/common/pod_array_test.cpp:
##########
@@ -0,0 +1,626 @@
+// 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 "vec/common/pod_array.h"
+
+#include <gtest/gtest.h>
+
+#include "vec/common/allocator_fwd.h"
+
+namespace doris {
+
+TEST(PODArrayTest, PODArrayBasicMove) {

Review Comment:
   warning: function 'TEST' exceeds recommended size/complexity thresholds 
[readability-function-size]
   ```cpp
   TEST(PODArrayTest, PODArrayBasicMove) {
   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/test/vec/common/pod_array_test.cpp:25:** 111 lines including whitespace 
and comments (threshold 80)
   ```cpp
   TEST(PODArrayTest, PODArrayBasicMove) {
   ^
   ```
   
   </details>
   



##########
be/test/vec/common/pod_array_test.cpp:
##########
@@ -0,0 +1,626 @@
+// 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 "vec/common/pod_array.h"
+
+#include <gtest/gtest.h>
+
+#include "vec/common/allocator_fwd.h"
+
+namespace doris {
+
+TEST(PODArrayTest, PODArrayBasicMove) {
+    static constexpr size_t initial_bytes = 32;
+    using Array = vectorized::PODArray<uint64_t, initial_bytes,
+                                       
AllocatorWithStackMemory<Allocator<false>, initial_bytes>>;
+
+    {
+        Array arr;
+        Array arr2;
+        arr2 = std::move(arr);
+    }
+
+    {
+        Array arr;
+
+        arr.push_back(1);
+        arr.push_back(2);
+        arr.push_back(3);
+
+        Array arr2;
+
+        arr2 = std::move(arr);
+
+        ASSERT_EQ(arr2.size(), 3);
+        ASSERT_EQ(arr2[0], 1);
+        ASSERT_EQ(arr2[1], 2);
+        ASSERT_EQ(arr2[2], 3);
+
+        arr = std::move(arr2);
+
+        ASSERT_EQ(arr.size(), 3);
+        ASSERT_EQ(arr[0], 1);
+        ASSERT_EQ(arr[1], 2);
+        ASSERT_EQ(arr[2], 3);
+    }
+
+    {
+        Array arr;
+
+        arr.push_back(1);
+        arr.push_back(2);
+        arr.push_back(3);
+        arr.push_back(4);
+        arr.push_back(5);
+
+        Array arr2;
+
+        arr2 = std::move(arr);
+
+        ASSERT_EQ(arr2.size(), 5);
+        ASSERT_EQ(arr2[0], 1);
+        ASSERT_EQ(arr2[1], 2);
+        ASSERT_EQ(arr2[2], 3);
+        ASSERT_EQ(arr2[3], 4);
+        ASSERT_EQ(arr2[4], 5);
+
+        arr = std::move(arr2);
+
+        ASSERT_EQ(arr.size(), 5);
+        ASSERT_EQ(arr[0], 1);
+        ASSERT_EQ(arr[1], 2);
+        ASSERT_EQ(arr[2], 3);
+        ASSERT_EQ(arr[3], 4);
+        ASSERT_EQ(arr[4], 5);
+    }
+
+    {
+        Array arr;
+
+        arr.push_back(1);
+        arr.push_back(2);
+        arr.push_back(3);
+
+        Array arr2;
+
+        arr2.push_back(4);
+        arr2.push_back(5);
+        arr2.push_back(6);
+        arr2.push_back(7);
+
+        arr2 = std::move(arr);
+
+        ASSERT_EQ(arr2.size(), 3);
+        ASSERT_EQ(arr2[0], 1);
+        ASSERT_EQ(arr2[1], 2);
+        ASSERT_EQ(arr2[2], 3);
+    }
+
+    {
+        Array arr;
+
+        arr.push_back(1);
+        arr.push_back(2);
+        arr.push_back(3);
+
+        Array arr2;
+
+        arr2.push_back(4);
+        arr2.push_back(5);
+        arr2.push_back(6);
+        arr2.push_back(7);
+        arr2.push_back(8);
+
+        arr = std::move(arr2);
+
+        ASSERT_EQ(arr.size(), 5);
+        ASSERT_EQ(arr[0], 4);
+        ASSERT_EQ(arr[1], 5);
+        ASSERT_EQ(arr[2], 6);
+        ASSERT_EQ(arr[3], 7);
+        ASSERT_EQ(arr[4], 8);
+    }
+}
+
+TEST(PODArrayTest, PODArrayBasicSwap) {

Review Comment:
   warning: function 'TEST' exceeds recommended size/complexity thresholds 
[readability-function-size]
   ```cpp
   TEST(PODArrayTest, PODArrayBasicSwap) {
   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/test/vec/common/pod_array_test.cpp:138:** 240 lines including 
whitespace and comments (threshold 80)
   ```cpp
   TEST(PODArrayTest, PODArrayBasicSwap) {
   ^
   ```
   
   </details>
   



-- 
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

Reply via email to