| 40 | } |
| 41 | |
| 42 | TEST(TestComputeRowMajorStrides, ZeroDimension) { |
| 43 | std::vector<int64_t> strides; |
| 44 | |
| 45 | std::vector<int64_t> shape1 = {0, 2, 3}; |
| 46 | ASSERT_OK(arrow::internal::ComputeRowMajorStrides(DoubleType(), shape1, &strides)); |
| 47 | EXPECT_THAT(strides, |
| 48 | testing::ElementsAre(sizeof(double), sizeof(double), sizeof(double))); |
| 49 | |
| 50 | std::vector<int64_t> shape2 = {2, 0, 3}; |
| 51 | strides.clear(); |
| 52 | ASSERT_OK(arrow::internal::ComputeRowMajorStrides(DoubleType(), shape2, &strides)); |
| 53 | EXPECT_THAT(strides, |
| 54 | testing::ElementsAre(sizeof(double), sizeof(double), sizeof(double))); |
| 55 | |
| 56 | std::vector<int64_t> shape3 = {2, 3, 0}; |
| 57 | strides.clear(); |
| 58 | ASSERT_OK(arrow::internal::ComputeRowMajorStrides(DoubleType(), shape3, &strides)); |
| 59 | EXPECT_THAT(strides, |
| 60 | testing::ElementsAre(sizeof(double), sizeof(double), sizeof(double))); |
| 61 | } |
| 62 | |
| 63 | TEST(TestComputeRowMajorStrides, MaximumSize) { |
| 64 | constexpr uint64_t total_length = |
nothing calls this directly
no test coverage detected