MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST_P

Function TEST_P

src/core/test/static_mem_alloc.cpp:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87} // anonymous namespace
88
89TEST_P(BasicCorrectness, Alloc) {
90 cg::StaticMemAlloc* allocator = this->m_allocator.get();
91 allocator->add(0, 1, 1, makeuk(0));
92 allocator->add(0, 1, 1, makeuk(1));
93 allocator->add(1, 2, 2, makeuk(2));
94 allocator->solve();
95 ASSERT_EQ(
96 std::max(align(2 + padding()), 2 * align(1 + padding())),
97 allocator->tot_alloc());
98 ASSERT_EQ(
99 std::max(align(2 + padding()), 2 * align(1 + padding())),
100 allocator->tot_alloc_lower_bound());
101}
102
103TEST_P(BasicCorrectness, Overwrite) {
104 cg::StaticMemAlloc* allocator = this->m_allocator.get();

Callers

nothing calls this directly

Calls 13

makeukFunction · 0.85
maxFunction · 0.85
tot_alloc_lower_boundMethod · 0.80
emplace_backMethod · 0.80
getMethod · 0.45
addMethod · 0.45
solveMethod · 0.45
tot_allocMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected