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

Function CheckStep

cpp/src/arrow/testing/generator_test.cc:25–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template <typename CType>
25void CheckStep(const Array& result, CType start, CType step, int64_t length) {
26 using ArrowType = typename CTypeTraits<CType>::ArrowType;
27
28 ASSERT_OK(result.ValidateFull());
29 ASSERT_EQ(result.type_id(), TypeTraits<ArrowType>::type_singleton()->id());
30 ASSERT_EQ(result.length(), length);
31 ASSERT_EQ(result.null_bitmap(), nullptr);
32 auto data = result.data()->GetValues<CType>(1);
33 CType current = start;
34 for (int64_t i = 0; i < length; ++i) {
35 ASSERT_EQ(data[i], current);
36 current += step;
37 }
38}
39
40TEST(StepTest, Default) {
41 for (auto length : {0, 1, 1024}) {

Callers 1

TYPED_TESTFunction · 0.85

Calls 6

type_singletonFunction · 0.50
ValidateFullMethod · 0.45
type_idMethod · 0.45
idMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected