cleol
[mcs.git] / tests / test-580.cs
blobe0c7dba68ad15edc3c2b72eb8c65d51e68b5c9da
1 using System;
3 public class Bla {
5 public static void BuildNode (ref string label)
7 string s = "a";
8 label += s + s + s + s;
11 public static void BuildNode (ref string[] label)
13 string s = "a";
14 int idx = 0;
15 label[idx++] += s + s + s + s;
18 public static void BuildNode_B (ref object label)
20 string s = "b";
21 label += s + s;
24 public static string BuildNode_C (ref string label)
26 string[] a = new string [2];
27 int i = 0;
28 a [0] = "a";
29 string s = "b";
31 a [i++] += label + s + s + s;
32 return a [i - 1];
35 public static string BuildNode_D ()
37 System.Collections.ArrayList values = new System.Collections.ArrayList ();
38 for (int i = 0; i < 6; i++)
39 values.Add (i);
40 string[] strs = new string [values.Count];
41 int idx = 0;
42 foreach (int val in values) {
43 strs [idx] = "Value:";
44 strs [idx++] += val.ToString ();
47 return strs [5];
50 public static void BuildNode_E (ref string[,] label)
52 string s = "a";
53 int idx = 0;
54 label = new string [1, 1];
55 label[idx++, idx - 1] += s + s + s + s;
58 public static int Main ()
60 String str = "test";
62 BuildNode (ref str);
63 Console.WriteLine (str);
64 if (str != "testaaaa")
65 return 1;
67 object ostr = "test";
68 BuildNode_B (ref ostr);
69 Console.WriteLine (ostr);
70 if (ostr.ToString () != "testbb")
71 return 2;
73 str = "test";
74 string res = BuildNode_C (ref str);
75 Console.WriteLine (str);
76 if (str != "test")
77 return 3;
79 Console.WriteLine (res);
80 if (res != "atestbbb")
81 return 4;
83 string[] sa = new string [1];
84 BuildNode (ref sa);
85 Console.WriteLine (sa [0]);
86 if (sa [0] != "aaaa")
87 return 5;
89 str = BuildNode_D ();
90 Console.WriteLine (str);
91 if (str != "Value:5")
92 return 6;
94 string[,] sa2 = null;
95 BuildNode_E (ref sa2);
96 Console.WriteLine (sa2 [0, 0]);
97 if (sa2 [0,0] != "aaaa")
98 return 7;
100 return 0;