ARROW-8467: [C++] Fix Array::View tests for big-endian platforms #6944
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the appropriate input on big-endian platform for test cases using ArrayFromJSON with fixed_size_binary.
I saw a problem with the following test:
Here, the expected strings are represented in binary as follows:
This test gives a value as raw int32. The current values assume only a little-endian platform as follows to generate the expected binary sequence.
IMHO, for big-endian platform, the following value should be given
These tests have the above problems:
TEST_F(TestChunkedArray, View) at https://github.com/apache/arrow/blob/master/cpp/src/arrow/table_test.cc#L175
TEST(TestArrayView, PrimitiveAsFixedSizeBinary) at https://github.com/apache/arrow/blob/master/cpp/src/arrow/array_view_test.cc#L105
TEST(TestArrayView, StructAsStructSimple) at https://github.com/apache/arrow/blob/master/cpp/src/arrow/array_view_test.cc#L126
TEST(TestArrayView, ExtensionType) at https://github.com/apache/arrow/blob/master/cpp/src/arrow/array_view_test.cc#L393