Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clone() for arrays test.

svn path=/trunk/mono/; revision=2319
  • Loading branch information...
commit ac9930427b5940dae2c0c2e5990d0d2c0cfbbd6e 1 parent 678a8d7
@illupus illupus authored
Showing with 35 additions and 0 deletions.
  1. +1 −0  mono/tests/Makefile.am
  2. +34 −0 mono/tests/arraylist-clone.cs
View
1  mono/tests/Makefile.am
@@ -34,6 +34,7 @@ TESTSRC= \
enum2.cs \
property.cs \
enumcast.cs \
+ arraylist-clone.cs \
setenv.cs \
vtype.cs \
isvaluetype.cs \
View
34 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;
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.