MCPcopy Create free account
hub / github.com/catboost/catboost / TestAlign

Method TestAlign

util/memory/smallobj_ut.cpp:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30private:
31 void TestAlign() {
32 TClass64::TPool pool(TDefaultAllocator::Instance());
33 TClass64* f1 = new (&pool) TClass64;
34 TClass64* f2 = new (&pool) TClass64;
35 TClass64* f3 = new (&pool) TClass64;
36 TClass64* f4 = new (&pool) TClass64;
37 UNIT_ASSERT_VALUES_EQUAL(64u, alignof(TClass64));
38 UNIT_ASSERT_VALUES_EQUAL((size_t)0, (size_t)(f1) & (alignof(TClass64) - 1));
39 UNIT_ASSERT_VALUES_EQUAL((size_t)0, (size_t)(f2) & (alignof(TClass64) - 1));
40 UNIT_ASSERT_VALUES_EQUAL((size_t)0, (size_t)(f3) & (alignof(TClass64) - 1));
41 UNIT_ASSERT_VALUES_EQUAL((size_t)0, (size_t)(f4) & (alignof(TClass64) - 1));
42 }
43
44 inline void TestError() {
45 TErrClass::TPool pool(TDefaultAllocator::Instance());

Callers

nothing calls this directly

Calls 1

InstanceFunction · 0.85

Tested by

no test coverage detected