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

Method CheckFourValues

cpp/src/arrow/util/small_vector_test.cc:155–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153
154 template <size_t N>
155 IntVectorType<N> CheckFourValues() {
156 IntVectorType<N> ints;
157 EXPECT_EQ(ints.size(), 0);
158 EXPECT_EQ(ints.capacity(), N);
159 EXPECT_EQ(ints.max_size(), Traits::MaxSizeFor(N));
160 EXPECT_TRUE(UsesStaticStorage(ints));
161
162 ints.emplace_back(3);
163 ints.emplace_back(42);
164 EXPECT_EQ(ints.size(), 2);
165 EXPECT_EQ(ints.capacity(), N);
166 EXPECT_EQ(ints[0], 3);
167 EXPECT_EQ(ints[1], 42);
168 EXPECT_TRUE(UsesStaticStorage(ints));
169
170 ints.push_back(IntLike(5));
171 ints.emplace_back(false);
172 EXPECT_EQ(ints.size(), 4);
173 EXPECT_EQ(ints[2], 5);
174 EXPECT_EQ(ints[3], 0);
175
176 ints[3] = IntLike(8);
177 EXPECT_EQ(ints[3], 8);
178 EXPECT_EQ(ints.back(), 8);
179 ints.front() = IntLike(-1);
180 EXPECT_EQ(ints[0], -1);
181 EXPECT_EQ(ints.front(), -1);
182
183 return ints;
184 }
185
186 void TestBasics() {
187 constexpr size_t N = Traits::TestSizeFor(4);

Callers

nothing calls this directly

Calls 7

UsesStaticStorageFunction · 0.85
emplace_backMethod · 0.80
push_backMethod · 0.80
backMethod · 0.80
sizeMethod · 0.45
capacityMethod · 0.45
max_sizeMethod · 0.45

Tested by

no test coverage detected