Skip to content

Commit

Permalink
Clone() for arrays test.
Browse files Browse the repository at this point in the history
svn path=/trunk/mono/; revision=2319
  • Loading branch information
illupus committed Feb 11, 2002
1 parent 678a8d7 commit ac99304
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions mono/tests/Makefile.am
Expand Up @@ -34,6 +34,7 @@ TESTSRC= \
enum2.cs \
property.cs \
enumcast.cs \
arraylist-clone.cs \
setenv.cs \
vtype.cs \
isvaluetype.cs \
Expand Down
34 changes: 34 additions & 0 deletions 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;
}
}
}

0 comments on commit ac99304

Please sign in to comment.