MCPcopy Create free account
hub / github.com/apache/arrow / operator()

Method operator()

cpp/src/arrow/c/bridge_test.cc:252–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250 flattened_metadata_(std::move(flattened_metadata)) {}
251
252 void operator()(struct ArrowSchema* c_export, bool inner = false) {
253 ASSERT_LT(flattened_index_, flattened_formats_.size());
254 ASSERT_LT(flattened_index_, flattened_names_.size());
255 ASSERT_LT(flattened_index_, flattened_flags_.size());
256 ASSERT_EQ(std::string(c_export->format), flattened_formats_[flattened_index_]);
257 ASSERT_EQ(std::string(c_export->name), flattened_names_[flattened_index_]);
258 std::string expected_md;
259 if (!flattened_metadata_.empty()) {
260 expected_md = flattened_metadata_[flattened_index_];
261 }
262 if (!expected_md.empty()) {
263 ASSERT_NE(c_export->metadata, nullptr);
264 ASSERT_EQ(std::string(c_export->metadata, expected_md.size()), expected_md);
265 } else {
266 ASSERT_EQ(c_export->metadata, nullptr);
267 }
268 ASSERT_EQ(c_export->flags, flattened_flags_[flattened_index_]);
269 ++flattened_index_;
270
271 if (c_export->dictionary != nullptr) {
272 // Recurse into dictionary
273 operator()(c_export->dictionary, true);
274 }
275
276 if (c_export->n_children > 0) {
277 ASSERT_NE(c_export->children, nullptr);
278 // Recurse into children
279 for (int64_t i = 0; i < c_export->n_children; ++i) {
280 ASSERT_NE(c_export->children[i], nullptr);
281 operator()(c_export->children[i], true);
282 }
283 } else {
284 ASSERT_EQ(c_export->children, nullptr);
285 }
286
287 if (!inner) {
288 // Caller gave the right number of names and format strings
289 ASSERT_EQ(flattened_index_, flattened_formats_.size());
290 ASSERT_EQ(flattened_index_, flattened_names_.size());
291 ASSERT_EQ(flattened_index_, flattened_flags_.size());
292 }
293 }
294
295 const std::vector<std::string> flattened_formats_;
296 const std::vector<std::string> flattened_names_;

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected