public void StressEnqueueTestCase() { /*ParallelTestHelper.Repeat (delegate { * queue = new ConcurrentQueue<int> (); * int amount = -1; * const int count = 10; * const int threads = 5; * * ParallelTestHelper.ParallelStressTest (queue, (q) => { * int t = Interlocked.Increment (ref amount); * for (int i = 0; i < count; i++) * queue.Enqueue (t); * }, threads); * * Assert.AreEqual (threads * count, queue.Count, "#-1"); * int[] values = new int[threads]; * int temp; * while (queue.TryDequeue (out temp)) { * values[temp]++; * } * * for (int i = 0; i < threads; i++) * Assert.AreEqual (count, values[i], "#" + i); * });*/ CollectionStressTestHelper.AddStressTest(new ConcurrentQueue <int> ()); }
public void AddStressTest() { CollectionStressTestHelper.AddStressTest(bag); }