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

Method TestError

util/memory/smallobj_ut.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 }
43
44 inline void TestError() {
45 TErrClass::TPool pool(TDefaultAllocator::Instance());
46 TErrClass* f = new (&pool) TErrClass(false);
47
48 delete f;
49
50 bool wasError = false;
51
52 try {
53 new (&pool) TErrClass(true);
54 } catch (...) {
55 wasError = true;
56 }
57
58 UNIT_ASSERT(wasError);
59 UNIT_ASSERT_EQUAL(f, new (&pool) TErrClass(false));
60 }
61
62 inline void TestAllocate() {
63 TClass::TPool pool(TDefaultAllocator::Instance());

Callers

nothing calls this directly

Calls 1

InstanceFunction · 0.85

Tested by

no test coverage detected