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

Method TestNested

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

Source from the content-addressed store, hash-verified

305
306 template <typename T>
307 void TestNested(const std::shared_ptr<T>& schema_like,
308 std::vector<std::string> flattened_formats,
309 std::vector<std::string> flattened_names,
310 std::vector<int64_t> flattened_flags = {},
311 std::vector<std::string> flattened_metadata = {}) {
312 SchemaExportChecker checker(std::move(flattened_formats), std::move(flattened_names),
313 std::move(flattened_flags),
314 std::move(flattened_metadata));
315
316 auto orig_bytes = pool_->bytes_allocated();
317
318 struct ArrowSchema c_export;
319 ASSERT_OK(ExportTraits<T>::ExportFunc(*schema_like, &c_export));
320
321 SchemaExportGuard guard(&c_export);
322 auto new_bytes = pool_->bytes_allocated();
323 ASSERT_GT(new_bytes, orig_bytes);
324
325 checker(&c_export);
326
327 // Release the ArrowSchema, underlying data should be destroyed
328 guard.Release();
329 ASSERT_EQ(pool_->bytes_allocated(), orig_bytes);
330 }
331
332 template <typename T>
333 void TestPrimitive(const std::shared_ptr<T>& schema_like, const char* format,

Callers

nothing calls this directly

Calls 2

bytes_allocatedMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected