New tests.
authorMarek Safar <marek.safar@gmail.com>
Tue, 27 Apr 2010 08:01:17 +0000 (08:01 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 27 Apr 2010 08:01:17 +0000 (08:01 -0000)
svn path=/trunk/mcs/; revision=156162

13 files changed:
mcs/tests/Makefile
mcs/tests/eval-test.cs
mcs/tests/gtest-262.cs
mcs/tests/gtest-474.cs [new file with mode: 0644]
mcs/tests/gtest-480.cs [new file with mode: 0644]
mcs/tests/gtest-481.cs [new file with mode: 0644]
mcs/tests/gtest-anon-24.cs
mcs/tests/gtest-anon-59.cs [new file with mode: 0644]
mcs/tests/gtest-exmethod-31.cs [new file with mode: 0644]
mcs/tests/known-issues-dmcs
mcs/tests/known-issues-gmcs
mcs/tests/test-746.cs [new file with mode: 0644]
mcs/tests/ver-il-gmcs.xml

index 209813b1086880622b3656678c3108cf858db4bd..9170cb295323a2b85a0d6faf37793b25bbd86932 100644 (file)
@@ -78,7 +78,7 @@ eval-test:
 build-compiler-lib:
        cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes
 
-check: build-compiler-lib eval-test
+qcheck: build-compiler-lib eval-test
        $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TOPTIONS) $(DEFINES)
 
 test-local:
@@ -86,16 +86,6 @@ test-local:
 
 run-test-local: $(TEST_ILS:.il=.dll) setup check
 
-# Temporary testing targets
-cecil:
-       rm -f *.mdb
-       $(TESTER) -mode:pos -files:'test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
-
-cecil2:
-       rm -f *.mdb
-       $(TESTER) -mode:pos -files:'*test-*.cs' -compiler:gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log -verbose
-# End  
-
 endif
 
 clean-local:
index 3a710ffaf65da3e99731d3d404eec47670104504..c9433a4f262f7d6d8b19115f4554c5e94e2d567a 100644 (file)
@@ -57,8 +57,8 @@ public class MyTest {
                }
 
                res = Evaluator.GetCompletions ("Converte", out prefix);
-               if (res [0] != "r<"){
-                       throw new Exception ("Expected one completion for Conveter<");
+               if (res [0] != "r"){
+                       throw new Exception ("Expected one completion for Converter");
                }
 
                res = Evaluator.GetCompletions ("Sys", out prefix);
@@ -77,7 +77,7 @@ public class MyTest {
                }
 
                res = Evaluator.GetCompletions ("new System.Text.StringBuilder () { ", out prefix);
-               if (res.Length != 4){
+               if (res.Length != 3){
                        throw new Exception ("Epxected 4 completions (Capacity Chars Length MaxCapacity)");
                }
 
index 51a31a954bbe7c78d2f0bd8ed9b1ae4487166d3d..9a71d8b6accb4c03b7e0d239b99cfd4e907f9ad5 100644 (file)
@@ -3,11 +3,18 @@ using System.Reflection;
 using System.Runtime.InteropServices;
 
 public class Test {
+       public enum ParamEnum {
+               None = 0,
+               Foo = 1,
+               Bar = 2
+       };
+       
        public void f1 ([System.Runtime.InteropServices.DefaultParameterValue (null)] object x) {}
        public void f2 ([System.Runtime.InteropServices.DefaultParameterValue (null)] string x) {}
        public void f3 ([System.Runtime.InteropServices.DefaultParameterValue (null)] Test x) {}
        public void f4 ([System.Runtime.InteropServices.DefaultParameterValue (1)] int x) {}
        public void f5 ([System.Runtime.InteropServices.DefaultParameterValue ((short) 1)] short x) {}
+       public void f6 ([DefaultParameterValue (ParamEnum.Foo)] ParamEnum n) {}
 
        static void Main ()
        {
diff --git a/mcs/tests/gtest-474.cs b/mcs/tests/gtest-474.cs
new file mode 100644 (file)
index 0000000..11d7ada
--- /dev/null
@@ -0,0 +1,17 @@
+class A<X>
+{
+       public const A<int> Value = B<int>.Value;
+}
+
+class B<T>
+{
+       public const A<T> Value = default (A<T>);
+}
+
+class C
+{
+       public static void Main ()
+       {
+               new B<int> ();
+       }
+}
diff --git a/mcs/tests/gtest-480.cs b/mcs/tests/gtest-480.cs
new file mode 100644 (file)
index 0000000..737e0e0
--- /dev/null
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+interface I<T> : ICollection<T>, IEnumerable<T>
+{
+}
+
+class C
+{
+       void Foo ()
+       {
+               I<object> o = null;
+               foreach (var v in o)
+                       Console.WriteLine (v);
+       }
+       
+       public static void Main ()
+       {
+               IList<int> list = new List<int> { 1, 3 };
+               var g = list.GetEnumerator ();
+       }
+}
diff --git a/mcs/tests/gtest-481.cs b/mcs/tests/gtest-481.cs
new file mode 100644 (file)
index 0000000..6a51fe7
--- /dev/null
@@ -0,0 +1,21 @@
+public class TestClass<T>
+{
+       private T[][] m_data;
+
+       public TestClass (int arrSize)
+       {
+               Add (ref m_data);
+       }
+
+       private static void Add (ref T[][] arr)
+       {
+       }
+}
+
+class C
+{
+       public static void Main ()
+       {
+               new TestClass<decimal> (4);
+       }
+}
index 8c97345554f85b719cde1149a20e0b2572da7504..103ba8d0537fc87baa348a1b8927e296b203322f 100644 (file)
@@ -14,6 +14,15 @@ interface IFoo<TOne,TTwo>
 {
 }
 
+class CA<T>
+{
+       public struct Nested
+       {
+               public static readonly T Value;
+               public readonly T Value2;
+       }
+}
+
 class Test
 {
        static Func<T[]> For<T> (List<T> list)
@@ -153,6 +162,14 @@ class Test
                };
        }
        
+       static Func<T[]> NestedTypeMutate<T> ()
+       {
+               var local = new CA<T>.Nested ();
+               return () => {
+                       return new [] { CA<T>.Nested.Value, local.Value2 };
+               };
+       }
+       
        public static int Main ()
        {
                if (For (new List<int> { 5, 10 })() [1] != 10)
@@ -201,6 +218,10 @@ class Test
                var t11 = TypeOf ("b");
                if (t11 () != typeof (string))
                        return 11;
+               
+               var t12 = NestedTypeMutate<ulong> ()();
+               if (t12 [0] != 0 || t12 [1] != 0)
+                       return 12;
 
                Console.WriteLine ("OK");
                return 0;
diff --git a/mcs/tests/gtest-anon-59.cs b/mcs/tests/gtest-anon-59.cs
new file mode 100644 (file)
index 0000000..39832ee
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+
+namespace TestGenericsSubtypeMatching
+{
+       public class Sender<T> : IDisposable
+       {
+               public void DoSend<TMessage> (Action<T> action)
+               {
+                       using (Sender<T> sub = new Sender<T> ())
+                       {
+                               Send (t =>
+                               {
+                                       action(t);
+                                       sub.ActionOnObject (t);
+                               });
+                       }
+               }
+               
+               private static void Send (Action<T> action)
+               {
+               }
+               
+               void ActionOnObject (object o)
+               {
+                       o.ToString ();
+               }
+       
+               #region IDisposable implementation
+               public void Dispose ()
+               {
+                       Console.WriteLine ("Dispose!");
+               }
+               
+               #endregion
+       }
+       
+       public class C
+       {
+               public static void Main ()
+               {
+                       new Sender<string> ().DoSend<bool>(l => Console.WriteLine (l));
+               }
+       }
+}
diff --git a/mcs/tests/gtest-exmethod-31.cs b/mcs/tests/gtest-exmethod-31.cs
new file mode 100644 (file)
index 0000000..9ef1ad1
--- /dev/null
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using N2;
+
+namespace N
+{
+       static class S
+       {
+               internal static void Map<T>(this int i, Func<T, string> f)
+               {
+               }
+       }
+}
+
+namespace N2
+{
+       static class S2
+       {
+               internal static void Map(this int i, int k)
+               {
+               }
+       }
+}
+
+namespace M
+{
+       using N;
+       
+       class C
+       {
+               public static void Main ()
+               {
+                       1.Map(2);
+               }
+       }
+}
index 20cedd6e337bd2ae19ae770b87eb7d0145883d29..66a19f887efe742dbcd93d19efdadd70defc471b 100644 (file)
@@ -9,9 +9,17 @@ test-xml-027.cs
 gtest-230.cs
 gtest-316.cs verifier
 gtest-437.cs
+gtest-anon-47.cs
 
 test-416.cs bug #504085
 test-418.cs bug #504085
 test-454.cs bug #593342
+test-468.cs
+test-184.cs
+test-682.cs bug #530861
 test-704.cs IGNORE #472845
 test-715.cs bug #504085
+test-733.cs
+
+test-xml-030.cs
+
index 20cedd6e337bd2ae19ae770b87eb7d0145883d29..575dc76762f5d700128c4479a3eb3807644f8b04 100644 (file)
@@ -9,9 +9,13 @@ test-xml-027.cs
 gtest-230.cs
 gtest-316.cs verifier
 gtest-437.cs
+gtest-anon-47.cs
 
 test-416.cs bug #504085
 test-418.cs bug #504085
 test-454.cs bug #593342
+test-682.cs bug #530861
 test-704.cs IGNORE #472845
 test-715.cs bug #504085
+
+test-xml-030.cs
diff --git a/mcs/tests/test-746.cs b/mcs/tests/test-746.cs
new file mode 100644 (file)
index 0000000..49c1d88
--- /dev/null
@@ -0,0 +1,34 @@
+// Compiler options: -warnaserror -warn:4\r
+
+using System;
+
+interface IList \r
+{
+       int Count { get; set; }
+}
+
+interface ICounter\r
+{\r
+       void Count (int i);
+}
+\r
+interface IEx\r
+{\r
+       void Count (params int[] i);\r
+}\r
+
+interface IListCounter: IEx, IList, ICounter\r
+{\r
+}
+
+class Test\r
+{
+       static void Foo (IListCounter t)
+       {
+               t.Count (1); 
+       }
+       
+       public static void Main ()
+       {
+       }
+}
index 4594554e84d8ed918da0793bf2e4f8186244a22b..259b8bfde02e19438baf2aeab0db82f410537e27 100644 (file)
     </type>
     <type name="Fault">
       <method name="Void Main()">
-        <size>45</size>
+        <size>47</size>
       </method>
       <method name="System.String ToString()">
         <size>6</size>
       <method name="Void Main()">
         <size>163</size>
       </method>
+      <method name="Void f6(ParamEnum)">
+        <size>1</size>
+      </method>
     </type>
   </test>
   <test name="gtest-263.cs">
       </method>
     </type>
   </test>
+  <test name="gtest-474.cs">
+    <type name="A`1[X]">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="B`1[T]">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="C">
+      <method name="Void Main()">
+        <size>7</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-475.cs">
     <type name="Value`1[T]">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="gtest-479.cs">
+    <type name="A">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="B">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="M">
+      <method name="Void Test[T](I`1)">
+        <size>1</size>
+      </method>
+      <method name="Void Main()">
+        <size>21</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="gtest-480.cs">
+    <type name="C">
+      <method name="Void Foo()">
+        <size>55</size>
+      </method>
+      <method name="Void Main()">
+        <size>30</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="gtest-481.cs">
+    <type name="TestClass`1[T]">
+      <method name="Void Add(T[][] ByRef)">
+        <size>1</size>
+      </method>
+      <method name="Void .ctor(Int32)">
+        <size>18</size>
+      </method>
+    </type>
+    <type name="C">
+      <method name="Void Main()">
+        <size>8</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anon-1.cs">
     <type name="X">
       <method name="Void .ctor()">
         <size>26</size>
       </method>
       <method name="Int32 Main()">
-        <size>468</size>
+        <size>501</size>
       </method>
     </type>
     <type name="Test+&lt;For&gt;c__AnonStorey0`1[T]">
         <size>7</size>
       </method>
     </type>
+    <type name="CA`1[T]">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="Test">
+      <method name="System.Func`1[T[]] NestedTypeMutate[T]()">
+        <size>34</size>
+      </method>
+    </type>
+    <type name="Test+&lt;NestedTypeMutate&gt;c__AnonStoreyC`1[T]">
+      <method name="T[] &lt;&gt;m__C()">
+        <size>37</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
   </test>
   <test name="gtest-anon-25.cs">
     <type name="HS`1[T]">
       </method>
     </type>
   </test>
-  <test name="gtest-anon-47.cs">
-    <type name="C">
-      <method name="System.Func`2[T1,System.Func`2[T2,System.Action`1[T3]]] Curry[T1,T2,T3](System.Action`3[T1,T2,T3])">
-        <size>26</size>
-      </method>
-    </type>
-    <type name="Test">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-      <method name="Int32 Main()">
-        <size>59</size>
-      </method>
-      <method name="Void &lt;Main&gt;m__3(Int32, Int32, Int32)">
-        <size>23</size>
-      </method>
-    </type>
-    <type name="C+&lt;Curry&gt;c__AnonStorey0`3[T1,T2,T3]">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-      <method name="System.Func`2[T2,System.Action`1[T3]] &lt;&gt;m__0(T1)">
-        <size>33</size>
-      </method>
-    </type>
-    <type name="C+&lt;Curry&gt;c__AnonStorey0`3+&lt;Curry&gt;c__AnonStorey1`3[T1,T2,T3]">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-      <method name="System.Action`1[T3] &lt;&gt;m__1(T2)">
-        <size>45</size>
-      </method>
-    </type>
-    <type name="C+&lt;Curry&gt;c__AnonStorey0`3+&lt;Curry&gt;c__AnonStorey1`3+&lt;Curry&gt;c__AnonStorey2`3[T1,T2,T3]">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-      <method name="Void &lt;&gt;m__2(T3)">
-        <size>35</size>
-      </method>
-    </type>
-  </test>
   <test name="gtest-anon-48.cs">
     <type name="GeneratorEnumerable`1[T]">
       <method name="Void .ctor(Func`1)">
       </method>
     </type>
   </test>
+  <test name="gtest-anon-59.cs">
+    <type name="TestGenericsSubtypeMatching.Sender`1[T]">
+      <method name="Void DoSend[TMessage](System.Action`1[T])">
+        <size>83</size>
+      </method>
+      <method name="Void Send(System.Action`1[T])">
+        <size>1</size>
+      </method>
+      <method name="Void ActionOnObject(System.Object)">
+        <size>8</size>
+      </method>
+      <method name="Void Dispose()">
+        <size>11</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="TestGenericsSubtypeMatching.C">
+      <method name="Void Main()">
+        <size>40</size>
+      </method>
+      <method name="Void &lt;Main&gt;m__1(System.String)">
+        <size>7</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="TestGenericsSubtypeMatching.Sender`1+&lt;DoSend&gt;c__AnonStorey0`1[T,TMessage]">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="TestGenericsSubtypeMatching.Sender`1+&lt;DoSend&gt;c__AnonStorey1`1[T,TMessage]">
+      <method name="Void &lt;&gt;m__0(T)">
+        <size>35</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anon-6.cs">
     <type name="X">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="gtest-exmethod-31.cs">
+    <type name="N.S">
+      <method name="Void Map[T](Int32, System.Func`2[T,System.String])">
+        <size>1</size>
+      </method>
+    </type>
+    <type name="N2.S2">
+      <method name="Void Map(Int32, Int32)">
+        <size>1</size>
+      </method>
+    </type>
+    <type name="M.C">
+      <method name="Void Main()">
+        <size>8</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-friend-01.cs">
     <type name="Test">
       <method name="Void .ctor()">
         <size>7</size>
       </method>
       <method name="Boolean MoveNext()">
-        <size>183</size>
+        <size>184</size>
       </method>
       <method name="Void Dispose()">
         <size>8</size>
       </method>
     </type>
   </test>
+  <test name="gtest-optional-08.cs">
+    <type name="Tests">
+      <method name="Int32 Main()">
+        <size>36</size>
+      </method>
+      <method name="Void .ctor(String)">
+        <size>14</size>
+      </method>
+      <method name="Void .ctor(Int32)">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-partial-01.cs">
     <type name="B`1[U]">
       <method name="Void .ctor()">
         <size>12</size>
       </method>
       <method name="Int32 Main()">
-        <size>25</size>
+        <size>29</size>
       </method>
     </type>
   </test>
       </method>
     </type>
   </test>
-  <test name="test-450.cs">
-    <type name="MyAttribute">
-      <method name="Void .ctor(String)">
-        <size>7</size>
-      </method>
-    </type>
-    <type name="X">
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-      <method name="Void Main()">
-        <size>1</size>
-      </method>
-    </type>
-  </test>
   <test name="test-451.cs">
     <type name="Test">
       <method name="Void .ctor()">
         <size>7</size>
       </method>
       <method name="Void Main()">
-        <size>21</size>
+        <size>25</size>
       </method>
     </type>
     <type name="Foo">
       </method>
     </type>
   </test>
-  <test name="test-682.cs">
-    <type name="broken_cast">
-      <method name="Void report(System.String)">
-        <size>7</size>
-      </method>
-      <method name="Void conv_ovf_i(Int64, Boolean)">
-        <size>73</size>
-      </method>
-      <method name="Void conv_ovf_i_un(Int64, Boolean)">
-        <size>73</size>
-      </method>
-      <method name="Void conv_ovf_u(Int64, Boolean)">
-        <size>73</size>
-      </method>
-      <method name="Void conv_ovf_u_un(Int64, Boolean)">
-        <size>73</size>
-      </method>
-      <method name="Int32 Main()">
-        <size>472</size>
-      </method>
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-  </test>
   <test name="test-683.cs">
     <type name="broken_cast">
       <method name="Void .ctor()">
         <size>7</size>
       </method>
       <method name="Int32 Main()">
-        <size>61</size>
+        <size>65</size>
       </method>
     </type>
   </test>
   <test name="test-740.cs">
     <type name="FixedTest">
       <method name="Int32 Main()">
-        <size>318</size>
+        <size>348</size>
       </method>
       <method name="Void .ctor()">
         <size>7</size>
       </method>
     </type>
   </test>
+  <test name="test-746.cs">
+    <type name="Test">
+      <method name="Void Foo(IListCounter)">
+        <size>8</size>
+      </method>
+      <method name="Void Main()">
+        <size>1</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-747.cs">
     <type name="B">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="test-752.cs">
+    <type name="M">
+      <method name="Void Main()">
+        <size>1</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-76.cs">
     <type name="foo">
       <method name="Void .ctor()">