From bc77800155272be1532fb9ebebee9f98dd2d6668 Mon Sep 17 00:00:00 2001 From: Bart De Smet Date: Thu, 13 Apr 2017 13:34:47 -0700 Subject: [PATCH] Removing check for absence of Stopwatch. --- .../Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs | 4 ---- .../Concurrency/ConcurrencyAbstractionLayerImpl.cs | 4 ---- .../src/System.Reactive/Concurrency/EventLoopScheduler.cs | 2 -- .../src/System.Reactive/Concurrency/NewThreadScheduler.cs | 2 -- .../src/System.Reactive/Concurrency/TaskPoolScheduler.cs | 2 -- .../src/System.Reactive/Concurrency/ThreadPoolScheduler.cs | 2 -- Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs | 2 -- .../Tests/Concurrency/EventLoopSchedulerTest.cs | 2 -- .../Tests/Concurrency/NewThreadSchedulerTest.cs | 2 -- .../Tests.System.Reactive/Tests/Concurrency/StopwatchTest.cs | 2 -- .../Tests/Concurrency/TaskPoolSchedulerTest.cs | 2 -- .../Tests/Concurrency/ThreadPoolSchedulerTest.cs | 4 ---- .../Tests/DefaultConcurrencyAbstractionLayerTest.cs | 2 +- 13 files changed, 1 insertion(+), 31 deletions(-) diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs index 298754d68..69ee7a19e 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs @@ -74,11 +74,7 @@ public void Sleep(TimeSpan timeout) public IStopwatch StartStopwatch() { -#if !NO_STOPWATCH return new StopwatchImpl(); -#else - return new DefaultStopwatch(); -#endif } public bool SupportsLongRunning diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs index 3e0b297a6..9847bf81e 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs @@ -61,11 +61,7 @@ public void Sleep(TimeSpan timeout) public IStopwatch StartStopwatch() { -#if !NO_STOPWATCH return new StopwatchImpl(); -#else - return new DefaultStopwatch(); -#endif } public bool SupportsLongRunning diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs index 1e5b1e4b4..b16456b57 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs @@ -231,7 +231,6 @@ public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func< return StableCompositeDisposable.Create(d, gate); } -#if !NO_STOPWATCH /// /// Starts a new stopwatch object. /// @@ -245,7 +244,6 @@ public override IStopwatch StartStopwatch() // return new StopwatchImpl(); } -#endif /// /// Ends the thread associated with this scheduler. All remaining work in the scheduler queue is abandoned. diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs index cebc94193..22ed4a417 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs @@ -177,7 +177,6 @@ public void Dispose() } } -#if !NO_STOPWATCH /// /// Starts a new stopwatch object. /// @@ -191,6 +190,5 @@ public override IStopwatch StartStopwatch() // return new StopwatchImpl(); } -#endif } } \ No newline at end of file diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs index 8d9cac394..6d04e7e87 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs @@ -150,7 +150,6 @@ public IDisposable ScheduleLongRunning(TState state, Action /// Gets a new stopwatch ob ject. /// @@ -164,7 +163,6 @@ public override IStopwatch StartStopwatch() // return new StopwatchImpl(); } -#endif /// /// Schedules a periodic piece of work by running a platform-specific timer to create tasks periodically. diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs index 3dcaf62fa..b453b6f23 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs @@ -94,7 +94,6 @@ public IDisposable ScheduleLongRunning(TState state, Action /// Starts a new stopwatch object. /// @@ -108,7 +107,6 @@ public override IStopwatch StartStopwatch() // return new StopwatchImpl(); } -#endif /// /// Schedules a periodic piece of work, using a System.Threading.Timer object. diff --git a/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs b/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs index 051741ff7..50f52d576 100644 --- a/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs +++ b/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -#if !NO_STOPWATCH using System.Diagnostics; namespace System.Reactive.Concurrency @@ -27,4 +26,3 @@ public TimeSpan Elapsed } } } -#endif \ No newline at end of file diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs index 803deb34f..fdfe374bb 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs @@ -273,14 +273,12 @@ public void EventLoop_ScheduleActionDueNested() #endif #if !NO_PERF -#if !NO_STOPWATCH [Fact] public void Stopwatch() { StopwatchTest.Run(new EventLoopScheduler()); } #endif -#endif #if !NO_CDS [Fact] diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs index 2a76b78a0..3d2c79c36 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs @@ -61,13 +61,11 @@ public void NewThread_ScheduleActionDue() #endif #if !NO_PERF -#if !NO_STOPWATCH [Fact] public void Stopwatch() { StopwatchTest.Run(NewThreadScheduler.Default); } -#endif #endif [Fact] diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/StopwatchTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/StopwatchTest.cs index a8834d4a2..f1be4c556 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/StopwatchTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/StopwatchTest.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -#if !NO_STOPWATCH using System; using System.Reactive.Concurrency; using System.Threading; @@ -40,4 +39,3 @@ public static void Run(IStopwatchProvider stopwatchProvider) } } } -#endif \ No newline at end of file diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs index 842da1837..f7566ee04 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs @@ -109,13 +109,11 @@ public void TaskPool_ScheduleLongRunning() #endif #if !NO_PERF -#if !NO_STOPWATCH [Fact] public void Stopwatch() { StopwatchTest.Run(TaskPoolScheduler.Default); } -#endif #endif [Fact] diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs index 8e65560cc..6850b631a 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs @@ -189,8 +189,6 @@ public void ScheduleLongRunningCancel() Assert.True(n >= 10); } -#if !NO_STOPWATCH - [Fact] public void Stopwatch() { @@ -205,8 +203,6 @@ public void Stopwatch() Assert.True(s1 > s0); } -#endif - [Fact] public void Periodic_ArgumentChecking() { diff --git a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs index 6abd4f323..ad2da1673 100644 --- a/Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs +++ b/Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs @@ -310,7 +310,7 @@ private void Cant_Locate_Scheduler_NoPlib() } #endif -#if !NO_PERF && !NO_STOPWATCH +#if !NO_PERF [Fact] public void Stopwatch() {