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

Method TestAnyQueue

util/thread/pool_ut.cpp:52–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 };
51
52 inline void TestAnyQueue(IThreadPool* queue, size_t queueSize = 1000) {
53 TReallyFastRng32 rand(17);
54 const size_t cnt = 1000;
55
56 R = 0;
57
58 for (size_t i = 0; i < cnt; ++i) {
59 R ^= (long)rand.GenRand();
60 }
61
62 queue->Start(10, queueSize);
63 rand = TReallyFastRng32(17);
64
65 for (size_t i = 0; i < cnt; ++i) {
66 UNIT_ASSERT(queue->Add(new TTask(this, (long)rand.GenRand())));
67 }
68
69 queue->Stop();
70
71 UNIT_ASSERT_EQUAL(0, R);
72 }
73};
74
75class TFailAddQueue: public IThreadPool {

Callers 1

Y_UNIT_TESTFunction · 0.80

Calls 5

TReallyFastRng32Class · 0.85
GenRandMethod · 0.45
StartMethod · 0.45
AddMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected