diff options
author | Martin Baulig <martin@novell.com> | 2006-03-04 05:37:02 +0300 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2006-03-04 05:37:02 +0300 |
commit | df6b8aafef35e1ed02d36f4ef4ace5080c8fa7bd (patch) | |
tree | 4963693d7c52f486f8184223c0e98886e088a0f7 /mcs/tests/gtest-247.cs | |
parent | 034dd0eabbcc6739f1e67b765605ea848d15224c (diff) |
New test.
svn path=/trunk/mcs/; revision=57571
Diffstat (limited to 'mcs/tests/gtest-247.cs')
-rwxr-xr-x | mcs/tests/gtest-247.cs | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/mcs/tests/gtest-247.cs b/mcs/tests/gtest-247.cs new file mode 100755 index 00000000000..28260d85112 --- /dev/null +++ b/mcs/tests/gtest-247.cs @@ -0,0 +1,70 @@ +using System; +using System.Diagnostics; +using SCG = System.Collections.Generic; + +public abstract class EnumerableBase<T> : SCG.IEnumerable<T> +{ + public abstract SCG.IEnumerator<T> GetEnumerator (); + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () + { + return GetEnumerator (); + } +} + +public abstract class CollectionValueBase<T> : EnumerableBase<T> +{ + protected virtual void raiseItemsAdded (T item, int count) + { } + + protected class RaiseForRemoveAllHandler + { + CircularQueue<T> wasRemoved; + } + + public override abstract SCG.IEnumerator<T> GetEnumerator(); +} + +public class CircularQueue<T> : EnumerableBase<T> +{ + public override SCG.IEnumerator<T> GetEnumerator() + { + yield break; + } + + public virtual void Enqueue (T item) + { } +} + +public class HashSet<T> : CollectionValueBase<T> +{ + private bool searchoradd (ref T item, bool add, bool update, bool raise) + { + return true; + } + + public virtual void RemoveAll<U>(SCG.IEnumerable<U> items) where U : T + { + RaiseForRemoveAllHandler raiseHandler = new RaiseForRemoveAllHandler (); + } + + public virtual void AddAll<U> (SCG.IEnumerable<U> items) + where U : T + { + CircularQueue<T> wasAdded = new CircularQueue<T> (); + + foreach (T item in wasAdded) + raiseItemsAdded (item, 1); + } + + public override SCG.IEnumerator<T> GetEnumerator() + { + yield break; + } +} + +class X +{ + static void Main () + { } +} |