felipecrv commented on code in PR #35345:
URL: https://github.com/apache/arrow/pull/35345#discussion_r1396631946


##########
cpp/src/arrow/array/concatenate_test.cc:
##########
@@ -69,33 +99,117 @@ class ConcatenateTest : public ::testing::Test {
     return slices;
   }
 
+  std::shared_ptr<Buffer> ValidityBitmap(int64_t size, double 
null_probability) {
+    return rag_.NullBitmap(size, null_probability, kDefaultBufferAlignment,
+                           default_memory_pool());
+  }
+
   template <typename PrimitiveType>
-  std::shared_ptr<Array> GeneratePrimitive(int64_t size, double 
null_probability) {
+  std::shared_ptr<Array> PrimitiveArray(int64_t size, double null_probability) 
{
     if (std::is_same<PrimitiveType, BooleanType>::value) {
-      return rng_.Boolean(size, 0.5, null_probability);
+      return rag_.Boolean(size, 0.5, null_probability);
     }
-    return rng_.Numeric<PrimitiveType, uint8_t>(size, 0, 127, 
null_probability);
+    return rag_.Numeric<PrimitiveType, uint8_t>(size, 0, 127, 
null_probability);
+  }
+
+  std::shared_ptr<Array> StringArray(int64_t size, double null_probability) {
+    return rag_.String(size, /*min_length =*/0, /*max_length =*/15, 
null_probability);
+  }
+
+  std::shared_ptr<Array> LargeStringArray(int64_t size, double 
null_probability) {
+    return rag_.LargeString(size, /*min_length =*/0, /*max_length =*/15,
+                            null_probability);
+  }
+
+  std::shared_ptr<Array> StringViewArray(int64_t size, double 
null_probability) {
+    return rag_.StringView(size, /*min_length =*/0, /*max_length =*/40, 
null_probability,
+                           /*max_buffer_length=*/200);
+  }
+
+  std::shared_ptr<Array> ArrayOf(std::shared_ptr<DataType> type, int64_t size,
+                                 double null_probability) {
+    return rag_.ArrayOf(std::move(type), size, null_probability);
+  }
+
+  // TODO(GH-38656): Use the random array generators from testing/random.h here

Review Comment:
   @pitrou I isolated all the random-generation code in this class and removed 
the complicated `List[View]ConcatenationChecker` templates.



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

Reply via email to