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

Function TEST_F

cpp/src/arrow/chunked_array_test.cc:56–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54};
55
56TEST_F(TestChunkedArray, Make) {
57 ASSERT_RAISES(Invalid, ChunkedArray::Make({}));
58
59 ASSERT_OK_AND_ASSIGN(std::shared_ptr<ChunkedArray> result,
60 ChunkedArray::Make({}, int64()));
61 AssertTypeEqual(*int64(), *result->type());
62 ASSERT_EQ(result->num_chunks(), 0);
63 // Empty chunked arrays are treated as CPU-allocated.
64 ASSERT_TRUE(result->is_cpu());
65
66 auto chunk0 = ArrayFromJSON(int8(), "[0, 1, 2]");
67 auto chunk1 = ArrayFromJSON(int16(), "[3, 4, 5]");
68
69 ASSERT_OK_AND_ASSIGN(result, ChunkedArray::Make({chunk0, chunk0}));
70 ASSERT_OK_AND_ASSIGN(auto result2, ChunkedArray::Make({chunk0, chunk0}, int8()));
71 // All chunks are CPU-accessible.
72 ASSERT_TRUE(result->is_cpu());
73 ASSERT_TRUE(result2->is_cpu());
74 AssertChunkedEqual(*result, *result2);
75
76 ASSERT_RAISES(TypeError, ChunkedArray::Make({chunk0, chunk1}));
77 ASSERT_RAISES(TypeError, ChunkedArray::Make({chunk0}, int16()));
78}
79
80TEST_F(TestChunkedArray, ComputeLogicalNullCount) {
81 // For types with a validity bitmap, the logical null count matches

Callers

nothing calls this directly

Calls 15

ArrayFromJSONFunction · 0.85
AssertChunkedEqualFunction · 0.85
default_memory_poolFunction · 0.85
run_end_encodedFunction · 0.85
listFunction · 0.85
key_value_metadataFunction · 0.85
genFunction · 0.85
PrintArrayDiffFunction · 0.85
fixed_size_binaryFunction · 0.85
MakeScalarFunction · 0.85
MakeNullScalarFunction · 0.85
oneFunction · 0.85

Tested by

no test coverage detected