Data generation for test case below
| 936 | |
| 937 | // Data generation for test case below |
| 938 | void MakeBatchArrays(const std::shared_ptr<Schema>& schema, const int num_rows, |
| 939 | std::vector<std::shared_ptr<Array>>* arrays) { |
| 940 | const float null_prob = 0.25f; |
| 941 | random::RandomArrayGenerator rand(0x564a3bf0); |
| 942 | |
| 943 | *arrays = {rand.Boolean(num_rows, 0.75, null_prob), |
| 944 | rand.Int8(num_rows, 0, 100, null_prob), |
| 945 | rand.Int32(num_rows, -1000, 1000, null_prob), |
| 946 | rand.UInt64(num_rows, 0, 1UL << 16, null_prob)}; |
| 947 | |
| 948 | static const int kBufferSize = 10; |
| 949 | static uint8_t buffer[kBufferSize]; |
| 950 | static uint32_t seed = 0; |
| 951 | StringBuilder string_builder; |
| 952 | for (int i = 0; i < num_rows; ++i) { |
| 953 | random_ascii(kBufferSize, seed++, buffer); |
| 954 | ASSERT_OK(string_builder.Append(buffer, kBufferSize)); |
| 955 | } |
| 956 | std::shared_ptr<Array> v3; |
| 957 | ASSERT_OK(string_builder.Finish(&v3)); |
| 958 | |
| 959 | arrays->emplace_back(v3); |
| 960 | } |
| 961 | |
| 962 | TEST(TestJsonFileReadWrite, BasicRoundTrip) { |
| 963 | auto v1_type = boolean(); |
no test coverage detected