From: Marek Safar Date: Tue, 27 Apr 2010 08:01:17 +0000 (-0000) Subject: New tests. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=2d23bfcbce7a3f7e54dcd5911adb88b244baca35 New tests. svn path=/trunk/mcs/; revision=156162 --- 2d23bfcbce7a3f7e54dcd5911adb88b244baca35 diff --cc mcs/tests/Makefile index 209813b1086,4ddeabc7ca8..9170cb29532 --- a/mcs/tests/Makefile +++ b/mcs/tests/Makefile @@@ -78,24 -76,24 +78,14 @@@ eval-test build-compiler-lib: cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes --check: build-compiler-lib eval-test - $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TOPTIONS) ++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: @: 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: diff --cc mcs/tests/eval-test.cs index 3a710ffaf65,3a710ffaf65..c9433a4f262 --- a/mcs/tests/eval-test.cs +++ b/mcs/tests/eval-test.cs @@@ -57,8 -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 +77,7 @@@ } 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)"); } diff --cc mcs/tests/gtest-262.cs index 51a31a954bb,51a31a954bb..9a71d8b6acc --- a/mcs/tests/gtest-262.cs +++ b/mcs/tests/gtest-262.cs @@@ -3,11 -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 --cc mcs/tests/gtest-474.cs index 00000000000,00000000000..11d7ada553b new file mode 100644 --- /dev/null +++ b/mcs/tests/gtest-474.cs @@@ -1,0 -1,0 +1,17 @@@ ++class A ++{ ++ public const A Value = B.Value; ++} ++ ++class B ++{ ++ public const A Value = default (A); ++} ++ ++class C ++{ ++ public static void Main () ++ { ++ new B (); ++ } ++} diff --cc mcs/tests/gtest-480.cs index 00000000000,00000000000..737e0e07d0a new file mode 100644 --- /dev/null +++ b/mcs/tests/gtest-480.cs @@@ -1,0 -1,0 +1,22 @@@ ++using System; ++using System.Collections.Generic; ++ ++interface I : ICollection, IEnumerable ++{ ++} ++ ++class C ++{ ++ void Foo () ++ { ++ I o = null; ++ foreach (var v in o) ++ Console.WriteLine (v); ++ } ++ ++ public static void Main () ++ { ++ IList list = new List { 1, 3 }; ++ var g = list.GetEnumerator (); ++ } ++} diff --cc mcs/tests/gtest-481.cs index 00000000000,00000000000..6a51fe7c344 new file mode 100644 --- /dev/null +++ b/mcs/tests/gtest-481.cs @@@ -1,0 -1,0 +1,21 @@@ ++public class TestClass ++{ ++ 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 (4); ++ } ++} diff --cc mcs/tests/gtest-anon-24.cs index 8c97345554f,8c97345554f..103ba8d0537 --- a/mcs/tests/gtest-anon-24.cs +++ b/mcs/tests/gtest-anon-24.cs @@@ -14,6 -14,6 +14,15 @@@ interface IFoo ++{ ++ public struct Nested ++ { ++ public static readonly T Value; ++ public readonly T Value2; ++ } ++} ++ class Test { static Func For (List list) @@@ -153,6 -153,6 +162,14 @@@ }; } ++ static Func NestedTypeMutate () ++ { ++ var local = new CA.Nested (); ++ return () => { ++ return new [] { CA.Nested.Value, local.Value2 }; ++ }; ++ } ++ public static int Main () { if (For (new List { 5, 10 })() [1] != 10) @@@ -201,6 -201,6 +218,10 @@@ var t11 = TypeOf ("b"); if (t11 () != typeof (string)) return 11; ++ ++ var t12 = NestedTypeMutate ()(); ++ if (t12 [0] != 0 || t12 [1] != 0) ++ return 12; Console.WriteLine ("OK"); return 0; diff --cc mcs/tests/gtest-anon-59.cs index 00000000000,00000000000..39832ee4f4e new file mode 100644 --- /dev/null +++ b/mcs/tests/gtest-anon-59.cs @@@ -1,0 -1,0 +1,44 @@@ ++using System; ++ ++namespace TestGenericsSubtypeMatching ++{ ++ public class Sender : IDisposable ++ { ++ public void DoSend (Action action) ++ { ++ using (Sender sub = new Sender ()) ++ { ++ Send (t => ++ { ++ action(t); ++ sub.ActionOnObject (t); ++ }); ++ } ++ } ++ ++ private static void Send (Action 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 ().DoSend(l => Console.WriteLine (l)); ++ } ++ } ++} diff --cc mcs/tests/gtest-exmethod-31.cs index 00000000000,00000000000..9ef1ad1e480 new file mode 100644 --- /dev/null +++ b/mcs/tests/gtest-exmethod-31.cs @@@ -1,0 -1,0 +1,36 @@@ ++using System; ++using System.Collections.Generic; ++using N2; ++ ++namespace N ++{ ++ static class S ++ { ++ internal static void Map(this int i, Func 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); ++ } ++ } ++} diff --cc mcs/tests/known-issues-dmcs index 20cedd6e337,58cc9c7e589..66a19f887ef --- a/mcs/tests/known-issues-dmcs +++ b/mcs/tests/known-issues-dmcs @@@ -7,11 -7,11 +7,19 @@@ 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 ++ diff --cc mcs/tests/known-issues-gmcs index 20cedd6e337,58cc9c7e589..575dc76762f --- a/mcs/tests/known-issues-gmcs +++ b/mcs/tests/known-issues-gmcs @@@ -7,11 -7,11 +7,15 @@@ 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-733.cs ++ ++test-xml-030.cs diff --cc mcs/tests/test-746.cs index 00000000000,00000000000..49c1d88ca32 new file mode 100644 --- /dev/null +++ b/mcs/tests/test-746.cs @@@ -1,0 -1,0 +1,34 @@@ ++// Compiler options: -warnaserror -warn:4 ++ ++using System; ++ ++interface IList ++{ ++ int Count { get; set; } ++} ++ ++interface ICounter ++{ ++ void Count (int i); ++} ++ ++interface IEx ++{ ++ void Count (params int[] i); ++} ++ ++interface IListCounter: IEx, IList, ICounter ++{ ++} ++ ++class Test ++{ ++ static void Foo (IListCounter t) ++ { ++ t.Count (1); ++ } ++ ++ public static void Main () ++ { ++ } ++} diff --cc mcs/tests/ver-il-gmcs.xml index 4594554e84d,f02c0191040..259b8bfde02 --- a/mcs/tests/ver-il-gmcs.xml +++ b/mcs/tests/ver-il-gmcs.xml @@@ -5734,7 -5734,7 +5734,7 @@@ -- 45 ++ 47 6 @@@ -7226,6 -7265,6 +7226,9 @@@ 163 ++ ++ 1 ++ @@@ -11944,138 -12017,6 +11947,212 @@@ + + + + 1 + + + 7 + + + + + 1 + + + 7 + + + + + 8 + + + 7 + + + ++ ++ ++ ++ 7 ++ ++ ++ ++ ++ 7 ++ ++ ++ ++ ++ 7 ++ ++ ++ 7 ++ ++ ++ + + + + 7 + + + 1 + + + + + 2 + + + 7 + + + + + 7 + + + 16 + + + + + 7 + + + 7 + + + + + + + 10 + + + 15 + + + 7 + + + + + 1 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 1 + + + 7 + + + + + + + 1 + + + 1 + + + 13 + + + 7 + + + ++ ++ ++ ++ 7 ++ ++ ++ ++ ++ 7 ++ ++ ++ ++ ++ 1 ++ ++ ++ 21 ++ ++ ++ 7 ++ ++ ++ ++ ++ ++ ++ 55 ++ ++ ++ 30 ++ ++ ++ 7 ++ ++ ++ ++ ++ ++ ++ 1 ++ ++ ++ 18 ++ ++ ++ ++ ++ 8 ++ ++ ++ 7 ++ ++ ++ @@@ -12767,7 -12708,7 +12844,7 @@@ 26 -- 468 ++ 501 @@@ -12877,6 -12818,6 +12954,24 @@@ 7 ++ ++ ++ 7 ++ ++ ++ ++ ++ 34 ++ ++ ++ ++ ++ 37 ++ ++ ++ 7 ++ ++ @@@ -13732,48 -13673,48 +13827,6 @@@ -- -- -- -- 26 -- -- -- -- -- 7 -- -- -- 59 -- -- -- 23 -- -- -- -- -- 7 -- -- -- 33 -- -- -- -- -- 7 -- -- -- 45 -- -- -- -- -- 7 -- -- -- 35 -- -- -- @@@ -14272,6 -14213,6 +14325,49 @@@ ++ ++ ++ ++ 83 ++ ++ ++ 1 ++ ++ ++ 8 ++ ++ ++ 11 ++ ++ ++ 7 ++ ++ ++ ++ ++ 40 ++ ++ ++ 7 ++ ++ ++ 7 ++ ++ ++ ++ ++ 7 ++ ++ ++ ++ ++ 35 ++ ++ ++ 7 ++ ++ ++ @@@ -17358,33 -17299,6 +17454,53 @@@ + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 14 + + + 1 + + + 7 + + + ++ ++ ++ ++ 1 ++ ++ ++ ++ ++ 1 ++ ++ ++ ++ ++ 8 ++ ++ ++ 7 ++ ++ ++ @@@ -18058,7 -17972,7 +18174,7 @@@ 7 -- 183 ++ 184 8 @@@ -21004,6 -20832,6 +21120,19 @@@ ++ ++ ++ ++ 36 ++ ++ ++ 14 ++ ++ ++ 7 ++ ++ ++ @@@ -22598,7 -22426,7 +22727,7 @@@ 12 -- 25 ++ 29 @@@ -30931,21 -30759,21 +31060,6 @@@ -- -- -- -- 7 -- -- -- -- -- 7 -- -- -- 1 -- -- -- @@@ -30987,7 -30830,7 +31101,7 @@@ 7 -- 21 ++ 25 @@@ -36938,7 -36756,7 +37027,7 @@@ 7 -- 61 ++ 65 @@@ -37402,7 -37220,7 +37491,7 @@@ -- 318 ++ 348 7 @@@ -37417,181 -37235,6 +37506,194 @@@ + + + + 18 + + + 1 + + + 7 + + + + + + + 20 + + + + + 7 + + + + + 41 + + + 7 + + + + + + + 11 + + + 30 + + + 7 + + + + + + + 7 + + + 7 + + + + + 1 + + + 7 + + + + + 0 + + + 7 + + + + + 0 + + + 7 + + + + + 1 + + + 1 + + + 0 + + + 7 + + + + + + + 28 + + + 7 + + + ++ ++ ++ ++ 8 ++ ++ ++ 1 ++ ++ ++ 7 ++ ++ ++ + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 1 + + + 7 + + + + + + + 6 + + + 1 + + + 7 + + + + + 6 + + + 7 + + + + + 7 + + + + + + + 14 + + + 7 + + + @@@ -37623,31 -37266,6 +37725,41 @@@ + + + + 1 + + + 7 + + + + + + + 7 + + + + + 7 + + + 7 + + + ++ ++ ++ ++ 1 ++ ++ ++ 7 ++ ++ ++