MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/tensor_test.cc:42–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42TEST(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
63TEST(TestComputeRowMajorStrides, MaximumSize) {
64 constexpr uint64_t total_length =

Callers

nothing calls this directly

Calls 15

ComputeRowMajorStridesFunction · 0.85
Int8TypeClass · 0.85
Int16TypeClass · 0.85
WrapFunction · 0.85
AssertCountNonZeroFunction · 0.85
stridesMethod · 0.80
raw_dataMethod · 0.80
is_row_majorMethod · 0.80
is_column_majorMethod · 0.80
is_contiguousMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70

Tested by

no test coverage detected