9prady9 commented on a change in pull request #11694:
URL: https://github.com/apache/arrow/pull/11694#discussion_r756153599
##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -3348,4 +3358,54 @@ TEST(TestSwapEndianArrayData, InvalidLength) {
}
}
+template <typename T>
+class TestPrimitiveArray : public ::testing::Test {
+ public:
+ void SetUp() { pool_ = default_memory_pool(); }
+
+ protected:
+ MemoryPool* pool_;
+};
+
+TYPED_TEST_SUITE(TestPrimitiveArray, Primitives);
+
+TYPED_TEST(TestPrimitiveArray, IndexOperator) {
+ using ArrayBuilderPointer = std::shared_ptr<arrow::ArrayBuilder>;
+ using CurrentBuilderType = typename TypeParam::BuilderType;
+ using CurrentArrayType = typename TypeParam::ArrayType;
+ using T = typename TypeParam::T;
+
+ using CType = typename std::conditional<std::is_integral<T>::value ||
+ std::is_floating_point<T>::value,
+ T, typename
TypeParam::ConversionType>::type;
+
+ const std::vector<bool> valids = {true, true, true, false, true, true};
+ const std::vector<CType> values(
+ 6); // default/garbage values, not important for this test
Review comment:
@pitrou It had to be two types of vectors (`{{1,1}, {1,1}}` and `{1,
1}`, Hence removed and left with default values as actual value is not
important for checking if `[]` is returning original value. Please let me know
your thoughts.
--
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]