diff options
author | Paolo Molaro <lupus@oddwiz.org> | 2002-02-11 18:02:37 +0300 |
---|---|---|
committer | Paolo Molaro <lupus@oddwiz.org> | 2002-02-11 18:02:37 +0300 |
commit | ac9930427b5940dae2c0c2e5990d0d2c0cfbbd6e (patch) | |
tree | af16195acb91e21666b92a1df623624c459c7538 | |
parent | 678a8d7343d05a40bacbb26d266d2456a8c25714 (diff) |
Clone() for arrays test.
svn path=/trunk/mono/; revision=2319
-rw-r--r-- | mono/tests/Makefile.am | 1 | ||||
-rw-r--r-- | mono/tests/arraylist-clone.cs | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 651000cdc97..0871a579f87 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -34,6 +34,7 @@ TESTSRC= \ enum2.cs \ property.cs \ enumcast.cs \ + arraylist-clone.cs \ setenv.cs \ vtype.cs \ isvaluetype.cs \ diff --git a/mono/tests/arraylist-clone.cs b/mono/tests/arraylist-clone.cs new file mode 100644 index 00000000000..f8832828d28 --- /dev/null +++ b/mono/tests/arraylist-clone.cs @@ -0,0 +1,34 @@ + + +using System.IO; +using System; +using System.Collections; + +namespace T { + public class T { + string name="unset"; + + T(string n) { + name=n; + } + + public static int Main () { + ArrayList tlist=new ArrayList(), newlist; + T[] tarray = new T [2]; + T t1=new T("t1"); + T t2=new T("t2"); + tlist.Add(t1); + tlist.Add(t2); + + newlist=(ArrayList)tlist.Clone(); + newlist.CopyTo (tarray); + + if (tarray [0].name != "t1") + return 1; + if (tarray [1].name != "t2") + return 2; + + return 0; + } + } +} |