Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2002-11-23 02:03:53 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-11-23 02:03:53 +0300
commit8eac21b8b203e21075f0c3ac13f7702e7a3698cb (patch)
treef7a546184bb90e479dd1f292198ec8e0ed84483b /mcs/tests/test-34.cs
parent0cccb65c1b65a31d0eaed16ec93b04aa40116d8d (diff)
Improve test
svn path=/trunk/mcs/; revision=9152
Diffstat (limited to 'mcs/tests/test-34.cs')
-rw-r--r--mcs/tests/test-34.cs33
1 files changed, 32 insertions, 1 deletions
diff --git a/mcs/tests/test-34.cs b/mcs/tests/test-34.cs
index 44a9fca10ca..60399d53be4 100644
--- a/mcs/tests/test-34.cs
+++ b/mcs/tests/test-34.cs
@@ -4,6 +4,16 @@
//
using System;
+public struct FancyInt {
+ public int value;
+
+ public FancyInt (int v)
+ {
+ value = v;
+ }
+
+}
+
public class Blah {
static int got;
@@ -49,6 +59,17 @@ public class Blah {
return total;
}
+
+ static int AddFancy (params FancyInt [] vals)
+ {
+ int total = 0;
+
+ for (int i = 0; i < vals.Length; i++)
+ total += vals [i].value;
+
+ return total;
+ }
+
public static int Main ()
{
@@ -84,7 +105,17 @@ public class Blah {
if (AddArray (arr2) != 3)
return 11;
-
+
+ FancyInt f_one = new FancyInt (1);
+ FancyInt f_two = new FancyInt (2);
+
+ if (AddFancy (f_one) != 1)
+ return 12;
+
+ if (AddFancy (f_one, f_two) != 3)
+ return 13;
+
+ Console.WriteLine ("Test passes");
return 0;
}
}