| 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 | |
| 75 | class TFailAddQueue: public IThreadPool { |
no test coverage detected