From: Tanner Gooding Date: Thu, 19 Jul 2018 19:16:06 +0000 (-0700) Subject: Removing WINCORESYS usages from the test projects X-Git-Tag: accepted/tizen/unified/20190422.045933~1625 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21ade50e57e1f61fb7a1a4970adba12d72ec72f7;p=platform%2Fupstream%2Fcoreclr.git Removing WINCORESYS usages from the test projects --- diff --git a/tests/src/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj b/tests/src/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj index 39ce217..fc6226f 100644 --- a/tests/src/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj +++ b/tests/src/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj @@ -11,7 +11,7 @@ {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} ..\..\ BuildOnly - $(DefineConstants);WINCORESYS;$([System.String]::Copy('$(BuildArch)').ToUpper()) + $(DefineConstants);$([System.String]::Copy('$(BuildArch)').ToUpper()) true false diff --git a/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs b/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs index 3a64b5f..e47be32 100644 --- a/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs +++ b/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs @@ -9,6 +9,8 @@ namespace TestLibrary { public static class TestFramework { + private const int DEFAULT_SEED = 20010415; + public static void LogInformation(string str) { Logging.WriteLine(str); @@ -24,25 +26,24 @@ namespace TestLibrary public static void BeginTestCase(string title) { - int seed; -#if WINCORESYS - seed = 20010415; -#else - Random rand = new Random(); + int seed = DEFAULT_SEED; if (Environment.GetEnvironmentVariable("CORECLR_SEED") != null) { - try + string CORECLR_SEED = Environment.GetEnvironmentVariable("CORECLR_SEED"); + + if (!int.TryParse(CORECLR_SEED, out seed)) { - seed = int.Parse(Environment.GetEnvironmentVariable("CORECLR_SEED")); + if (string.Equals(CORECLR_SEED, "random", StringComparison.OrdinalIgnoreCase)) + { + seed = new Random().Next(); + } + else + { + seed = DEFAULT_SEED; + } } - catch (FormatException) { seed = rand.Next(); } - } - else - { - seed = rand.Next(); } -#endif Generator.m_rand = new Random(seed); diff --git a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs index 6a84e7f..32905f7 100644 --- a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs +++ b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs @@ -6,9 +6,6 @@ using System.Security; using System.Runtime.CompilerServices; using TestLibrary; -#if WINCORESYS -[assembly: AllowPartiallyTrustedCallers] -#endif // Class has two fields, x and y; we consider two instances to be equal (Equals returns true, // and GetHashCode returns the same for both instances) iff x==x and y==y class ClassWithEquivalence diff --git a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs index 300b242..77b6f8e 100644 --- a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs +++ b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs @@ -6,9 +6,6 @@ using System; using System.Security; -#if WINCORESYS -[assembly: AllowPartiallyTrustedCallers] -#endif public class Watcher { public static bool f_hasRun = false; diff --git a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs index a56bc02..7c07401 100644 --- a/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs +++ b/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs @@ -6,9 +6,6 @@ using System; using System.Security; -#if WINCORESYS -[assembly: AllowPartiallyTrustedCallers] -#endif public class Watcher { public static bool f_hasRun = false; diff --git a/tests/src/GC/Stress/Tests/573277.cs b/tests/src/GC/Stress/Tests/573277.cs index d2d5ce2..d36397e 100644 --- a/tests/src/GC/Stress/Tests/573277.cs +++ b/tests/src/GC/Stress/Tests/573277.cs @@ -10,10 +10,6 @@ using System.Security; using System.Collections.Generic; using System.Threading; -#if WINCORESYS -[assembly:AllowPartiallyTrustedCallers] -#endif - public class Test { public static bool fail = false; diff --git a/tests/src/GC/Stress/Tests/LargeObjectAlloc.cs b/tests/src/GC/Stress/Tests/LargeObjectAlloc.cs index 1324257..d273016 100644 --- a/tests/src/GC/Stress/Tests/LargeObjectAlloc.cs +++ b/tests/src/GC/Stress/Tests/LargeObjectAlloc.cs @@ -9,10 +9,6 @@ using System; using System.Threading; using System.Security; -#if WINCORESYS -[assembly: AllowPartiallyTrustedCallers] -#endif - internal class Mainy { public static void DoWork() diff --git a/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs b/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs index 9bcd074..5070eaf 100644 --- a/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs +++ b/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs @@ -11,9 +11,6 @@ using System; using System.Threading; using System.Security; -#if WINCORESYS -[assembly: AllowPartiallyTrustedCallers] -#endif namespace ThreadPool_Test { public class Fibonacci { private int fibnumber; diff --git a/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs b/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs index ccb5648..eaa2d7f 100644 --- a/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs +++ b/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs @@ -5,10 +5,6 @@ using System; using System.Security; using System.Threading; -#if WINCORESYS -[assembly:AllowPartiallyTrustedCallers] -#endif - public class CS_ThreadPoolNullChecks { public static void EventSig(Object state, bool wasSignalled) { Console.WriteLine("In EventSig: {0}.", Thread.CurrentThread.GetHashCode());