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

Function Wrap

util/system/context_ut.cpp:10–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8Y_UNIT_TEST_SUITE(TestContext) {
9 template <class F>
10 static TContClosure Wrap(F& f) {
11 struct TW: public ITrampoLine {
12 inline TW(F* ff) noexcept
13 : F_(ff)
14 {
15 }
16
17 void DoRun() override {
18 (*F_)();
19 }
20
21 F* F_;
22 char Buf[1000000];
23 };
24
25 static TDeque<TW> w;
26
27 auto& tw = w.emplace_back(&f);
28
29 return {&tw, TArrayRef(tw.Buf, sizeof(tw.Buf))};
30 }
31
32 Y_UNIT_TEST(TestExceptionSafety) {
33 TExceptionSafeContext main;

Callers 2

Y_UNIT_TESTFunction · 0.70
NewEntryWrapperMethod · 0.50

Calls 2

TArrayRefClass · 0.50
emplace_backMethod · 0.45

Tested by

no test coverage detected