Removing WINCORESYS usages from the test projects
authorTanner Gooding <tagoo@outlook.com>
Thu, 19 Jul 2018 19:16:06 +0000 (12:16 -0700)
committerTanner Gooding <tagoo@outlook.com>
Thu, 19 Jul 2018 23:50:21 +0000 (16:50 -0700)
tests/src/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj
tests/src/Common/CoreCLRTestLibrary/TestFramework.cs
tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs
tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs
tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs
tests/src/GC/Stress/Tests/573277.cs
tests/src/GC/Stress/Tests/LargeObjectAlloc.cs
tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs
tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs

index 39ce217..fc6226f 100644 (file)
@@ -11,7 +11,7 @@
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
     <CLRTestKind>BuildOnly</CLRTestKind>
-    <DefineConstants>$(DefineConstants);WINCORESYS;$([System.String]::Copy('$(BuildArch)').ToUpper())</DefineConstants>
+    <DefineConstants>$(DefineConstants);$([System.String]::Copy('$(BuildArch)').ToUpper())</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateRunScript>false</GenerateRunScript>
   </PropertyGroup>
index 3a64b5f..e47be32 100644 (file)
@@ -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);
 
index 6a84e7f..32905f7 100644 (file)
@@ -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
index a56bc02..7c07401 100644 (file)
@@ -6,9 +6,6 @@
 using System;
 using System.Security;
 
-#if WINCORESYS
-[assembly: AllowPartiallyTrustedCallers]
-#endif
 public class Watcher
 {
     public static bool f_hasRun = false;
index d2d5ce2..d36397e 100644 (file)
@@ -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;
index 1324257..d273016 100644 (file)
@@ -9,10 +9,6 @@ using System;
 using System.Threading;
 using System.Security;
 
-#if WINCORESYS
-[assembly: AllowPartiallyTrustedCallers]
-#endif
-
 internal class Mainy
 {
     public static void DoWork()
index 9bcd074..5070eaf 100644 (file)
@@ -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;
index ccb5648..eaa2d7f 100644 (file)
@@ -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());