[Test] public void TestIncorrectIteratorPos() { status s = fail; var i = new SeqIterator(c); // Reusing across iterations (wrong) for (int j = 0; !s.complete; j++) { s = i[i?to(4) : i?to(10) : i?to(15) : i.end]; if (j >= MaxIter) { throw new Ex("Too many iterations"); } } o(foo != 15); }
[Test] public void TestTernaryNotation() { status s = fail; for (int j = 0; !s.complete; j++) { var i = new SeqIterator(c); s = i[i? to(4) : i? to(10) : i? to(15) : i.end]; if (j >= MaxIter) { throw new Ex("Too many iterations"); } } o(foo, 15); }
[Test] public void B__75_ThreadSafeTernaryNotation() { foo = 0; status.log = false; var c = new Sequence(); status s = fail; var i = new SeqIterator(c); for (int j = 0; j < PerfTestIters; j++) { i.Reset(); s = i[i ? to(4) : i ? to(10) : i ? to(15) : i ? reset() : i.end]; } }
[SetUp] public void Setup() { s = new Sequence(); i = new SeqIterator(s); }