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

Function TEST_F

bolt/vector/tests/VectorEstimateFlatSizeTest.cpp:88–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86} // namespace
87
88TEST_F(VectorEstimateFlatSizeTest, fixedWidthNoNulls) {
89 // Fixed width vectors without nulls.
90 VectorPtr flat = makeFlatVector<int16_t>(1'000, int16At);
91 EXPECT_EQ(2976, flat->retainedSize());
92 EXPECT_EQ(2976, flat->estimateFlatSize());
93
94 flat = makeFlatVector<int32_t>(1'000, int32At);
95 EXPECT_EQ(4000, flat->retainedSize());
96 EXPECT_EQ(4000, flat->estimateFlatSize());
97
98 flat = makeFlatVector<int64_t>(1'000, int64At);
99 EXPECT_EQ(8096, flat->retainedSize());
100 EXPECT_EQ(8096, flat->estimateFlatSize());
101
102 flat = makeFlatVector<float>(1'000, floatAt);
103 EXPECT_EQ(4000, flat->retainedSize());
104 EXPECT_EQ(4000, flat->estimateFlatSize());
105
106 flat = makeFlatVector<double>(1'000, doubleAt);
107 EXPECT_EQ(8096, flat->retainedSize());
108 EXPECT_EQ(8096, flat->estimateFlatSize());
109
110 flat = makeFlatVector<bool>(1'000, boolAt);
111 EXPECT_EQ(160, flat->retainedSize());
112 EXPECT_EQ(160, flat->estimateFlatSize());
113}
114
115TEST_F(VectorEstimateFlatSizeTest, fixedWidthWithNulls) {
116 // Fixed width vectors with nulls. Nulls buffer adds a few bytes.

Callers

nothing calls this directly

Calls 15

wrapInDictionaryFunction · 0.85
flattenFunction · 0.85
makeArrayVectorFunction · 0.85
ARRAYFunction · 0.85
shortStringAtFunction · 0.85
MAPFunction · 0.85
childAtMethod · 0.80
has_valueMethod · 0.80
makeIndicesFunction · 0.50
poolFunction · 0.50
setNullFunction · 0.50
StringViewClass · 0.50

Tested by

no test coverage detected