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

Function TEST

cpp/src/arrow/buffer_test.cc:372–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372TEST(TestAllocate, Basics) {
373 ASSERT_OK_AND_ASSIGN(auto new_buffer, AllocateBuffer(1024));
374 auto mm = new_buffer->memory_manager();
375 ASSERT_TRUE(mm->is_cpu());
376 ASSERT_EQ(mm.get(), default_cpu_memory_manager().get());
377 auto cpu_mm = checked_pointer_cast<CPUMemoryManager>(mm);
378 ASSERT_EQ(cpu_mm->pool(), default_memory_pool());
379
380 auto pool = std::make_shared<ProxyMemoryPool>(default_memory_pool());
381 ASSERT_OK_AND_ASSIGN(new_buffer, AllocateBuffer(1024, pool.get()));
382 mm = new_buffer->memory_manager();
383 ASSERT_TRUE(mm->is_cpu());
384 cpu_mm = checked_pointer_cast<CPUMemoryManager>(mm);
385 ASSERT_EQ(cpu_mm->pool(), pool.get());
386 new_buffer.reset(); // Destroy before pool
387}
388
389TEST(TestAllocate, Bitmap) {
390 ASSERT_OK_AND_ASSIGN(auto new_buffer, AllocateBitmap(100));

Callers

nothing calls this directly

Calls 15

default_memory_poolFunction · 0.85
AssertIsCPUBufferFunction · 0.85
FromStringFunction · 0.85
AssertBufferEqualFunction · 0.85
SliceBufferFunction · 0.85
SliceBufferSafeFunction · 0.85
WrapFunction · 0.85
AllocateResizableBufferFunction · 0.85
BytesForBitsFunction · 0.85
AssertMyBufferEqualFunction · 0.85

Tested by

no test coverage detected