/// <summary> /// Clones the random states from parent scope and generates a new one for itself. /// Each time new scope is created, it is set as ts_lastCreatedScope on the current thread. /// </summary> internal Scope(RandomizerPool pool, IScope parent) { t_lastCreatedScope = this; _previousScope = t_currentScope; t_currentScope = this; _pool = pool; RandomizerType current; _pool.CreateScopeRandomizer(parent, out _scopeStates, out current); // mark the scope as constructed _current = current; }
public void TestMain() { _operationCanceledErrorMessage = SystemDataResourceManager.Instance.SQL_OperationCancelled; _severeErrorMessage = SystemDataResourceManager.Instance.SQL_SevereError; // pure random _randPool = new RandomizerPool(); SqlConnectionStringBuilder regularConnectionString = new SqlConnectionStringBuilder(DataTestUtility.TCPConnectionString); regularConnectionString.MultipleActiveResultSets = false; List <string> connStrings = new List <string>(); connStrings.Add(regularConnectionString.ToString()); connStrings.Add(regularConnectionString.ToString()); regularConnectionString.MultipleActiveResultSets = true; connStrings.Add(regularConnectionString.ToString()); _connectionStrings = connStrings.ToArray(); _2008Types = SqlRandomTypeInfoCollection.CreateSql2008Collection(); _endEvent = new ManualResetEvent(false); if (_randPool.ReproMode) { TestThread(); } else { for (int tcount = 0; tcount < ThreadCountDefault; tcount++) { Thread t = new Thread(TestThread); t.Start(); } } _endEvent.WaitOne(); }