MCPcopy Create free account
hub / github.com/bytedance/bolt / testConstantNull

Function testConstantNull

bolt/expression/tests/ConstantFlatVectorReaderTest.cpp:146–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145template <typename T>
146void testConstantNull(const T& reader, const VectorPtr& vector) {
147 ASSERT_TRUE(reader.mayHaveNulls());
148 ASSERT_TRUE(reader.mayHaveNullsRecursive());
149
150 for (vector_size_t i = 0; i < vector->size(); i++) {
151 ASSERT_FALSE(reader.isSet(i));
152 ASSERT_TRUE(reader.containsNull(i));
153 if (i > 0) {
154 ASSERT_TRUE(reader.containsNull(0, i));
155 }
156 ASSERT_TRUE(reader.containsNull(i, vector->size()));
157 }
158}
159
160TEST_F(ConstantFlatVectorReaderTest, constantNull) {
161 auto vector = makeConstant<int32_t>(std::nullopt, 10);

Callers 2

TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 5

mayHaveNullsMethod · 0.45
mayHaveNullsRecursiveMethod · 0.45
sizeMethod · 0.45
isSetMethod · 0.45
containsNullMethod · 0.45

Tested by

no test coverage detected