Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/tools/GCLogParser/parse-hb-log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ private static void PrintAllocToAllPassOneFiles()
{
strAlloc += string.Format("|{0,5}", AllocMB[procIndex]);
}
strAlloc += string.Format("|");
strAlloc += "|";
PrintToAllPassOneFiles(strAlloc);
}

Expand Down Expand Up @@ -613,7 +613,7 @@ private static void PrintHeader()
{
strHeader += string.Format("|{0,5}", procIndex);
}
strHeader += string.Format("|");
strHeader += "|";
PrintToAllPassOneFiles(strHeader);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void TestContainsGenericParameter1()

bool hasgenericParam = ti.ContainsGenericParameters;

Assert.True(hasgenericParam, string.Format("Failed!! TestContainsGenericParameter did not return correct result. "));
Assert.True(hasgenericParam, "Failed!! TestContainsGenericParameter did not return correct result. ");
}

// Verify ContainsGenericParameter
Expand All @@ -57,7 +57,7 @@ public static void TestContainsGenericParameter2()

bool hasgenericParam = ti.ContainsGenericParameters;

Assert.False(hasgenericParam, string.Format("Failed!! TestContainsGenericParameter did not return correct result. "));
Assert.False(hasgenericParam, "Failed!! TestContainsGenericParameter did not return correct result. ");
}

// Verify FullName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static void TokenSourceDispose()
}
catch
{
Assert.Fail(string.Format("TokenSourceDispose: > ctr.Dispose() failed when referring to a disposed CTS"));
Assert.Fail("TokenSourceDispose: > ctr.Dispose() failed when referring to a disposed CTS");
}

bool cr = tokenSource.IsCancellationRequested; //this is ok after dispose.
Expand Down Expand Up @@ -863,7 +863,7 @@ public static void ODEWhenDisposingLinkedCTS()
{
if (ex is ObjectDisposedException)
{
Assert.Fail(string.Format("Bug901737_ODEWhenDisposingLinkedCTS: - ODE Occurred!"));
Assert.Fail("Bug901737_ODEWhenDisposingLinkedCTS: - ODE Occurred!");
}
else
{
Expand Down Expand Up @@ -990,9 +990,9 @@ public static void DerivedCancellationTokenSource_Negative()
{
// Accessing the Token property should throw an ObjectDisposedException
if (c.Token.CanBeCanceled)
Assert.Fail(string.Format("DerivedCancellationTokenSource: Accessing the Token property should throw an ObjectDisposedException, but it did not."));
Assert.Fail("DerivedCancellationTokenSource: Accessing the Token property should throw an ObjectDisposedException, but it did not.");
else
Assert.Fail(string.Format("DerivedCancellationTokenSource: Accessing the Token property should throw an ObjectDisposedException, but it did not."));
Assert.Fail("DerivedCancellationTokenSource: Accessing the Token property should throw an ObjectDisposedException, but it did not.");
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void RunAsyncYieldAwaiterTests()
try { ya.GetResult(); }
catch
{
Assert.Fail(string.Format("RunAsyncYieldAwaiterTests > FAILURE. YieldAwaiter.GetResult threw inappropriately"));
Assert.Fail("RunAsyncYieldAwaiterTests > FAILURE. YieldAwaiter.GetResult threw inappropriately");
}
var mres = new ManualResetEventSlim();
Assert.False(ya.IsCompleted, "RunAsyncYieldAwaiterTests > FAILURE. YieldAwaiter.IsCompleted should always be false.");
Expand All @@ -67,7 +67,7 @@ public static void RunAsyncYieldAwaiterTests()
try { ya.GetResult(); }
catch
{
Assert.Fail(string.Format(" > FAILURE. YieldAwaiter.GetResult threw inappropriately"));
Assert.Fail(" > FAILURE. YieldAwaiter.GetResult threw inappropriately");
}
var mres = new ManualResetEventSlim();
Assert.False(ya.IsCompleted, " > FAILURE. YieldAwaiter.IsCompleted should always be false.");
Expand All @@ -79,7 +79,7 @@ public static void RunAsyncYieldAwaiterTests()
mres.Wait();
ya.GetResult();
}
catch { Assert.Fail(string.Format(" > FAILURE. Unexpected exception from Yield")); }
catch { Assert.Fail(" > FAILURE. Unexpected exception from Yield"); }
}, CancellationToken.None, TaskCreationOptions.None, new QUWITaskScheduler()).Wait();
}

Expand All @@ -94,7 +94,7 @@ public static void RunAsyncYieldAwaiterTests()
try { ya.GetResult(); }
catch
{
Assert.Fail(string.Format(" > FAILURE. YieldAwaiter.GetResult threw inappropriately"));
Assert.Fail(" > FAILURE. YieldAwaiter.GetResult threw inappropriately");
}
var mres = new ManualResetEventSlim();
Assert.False(ya.IsCompleted, " > FAILURE. YieldAwaiter.IsCompleted should always be false.");
Expand All @@ -106,7 +106,7 @@ public static void RunAsyncYieldAwaiterTests()
mres.Wait();
ya.GetResult();
}
catch { Assert.Fail(string.Format(" > FAILURE. Unexpected exception from Yield")); }
catch { Assert.Fail(" > FAILURE. Unexpected exception from Yield"); }
SynchronizationContext.SetSynchronizationContext(null);
}, CancellationToken.None, TaskCreationOptions.None, new QUWITaskScheduler()).Wait();
}
Expand All @@ -119,7 +119,7 @@ public static void RunAsyncYieldAwaiterTests()
try { ya.GetResult(); }
catch
{
Assert.Fail(string.Format(" > FAILURE. YieldAwaiter.GetResult threw inappropriately"));
Assert.Fail(" > FAILURE. YieldAwaiter.GetResult threw inappropriately");
}
var mres = new ManualResetEventSlim();
Assert.False(ya.IsCompleted, " > FAILURE. YieldAwaiter.IsCompleted should always be false.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,25 +258,25 @@ private void VerifyCancel(TaskInfo current)
if (current.Parent == null)
{
if (!ti.CancellationToken.IsCancellationRequested)
Assert.Fail(string.Format("Root task must be cancel-requested"));
Assert.Fail("Root task must be cancel-requested");
else if (_countdownEvent.IsSet && ti.Task.IsCanceled)
Assert.Fail(string.Format("Root task should not be cancelled when the whole tree has been created"));
Assert.Fail("Root task should not be cancelled when the whole tree has been created");
}
else if (current.Parent.CancelChildren)
{
// need to make sure the parent task at least called .Cancel() on the child
if (!ti.CancellationToken.IsCancellationRequested)
Assert.Fail(string.Format("Task which has been explicitly cancel-requested either by parent must have CancellationRequested set as true"));
Assert.Fail("Task which has been explicitly cancel-requested either by parent must have CancellationRequested set as true");
}
else if (ti.IsRespectParentCancellation)
{
if (ti.CancellationToken.IsCancellationRequested != current.Parent.CancellationToken.IsCancellationRequested)
Assert.Fail(string.Format("Task with RespectParentCancellationcontract is broken"));
Assert.Fail("Task with RespectParentCancellationcontract is broken");
}
else
{
if (ti.CancellationToken.IsCancellationRequested || ti.Task.IsCanceled)
Assert.Fail(string.Format("Inner non-directly canceled task which opts out RespectParentCancellationshould not be cancelled"));
Assert.Fail("Inner non-directly canceled task which opts out RespectParentCancellationshould not be cancelled");
}

// verify IsCanceled indicate successfully dequeued based on the observing that
Expand All @@ -303,7 +303,7 @@ private void VerifyWait(TaskInfo current)
if ((ti.Option & TaskCreationOptions.AttachedToParent) != 0
&& !ti.Task.IsCompleted)
{
Assert.Fail(string.Format("Inner attached task must complete"));
Assert.Fail("Inner attached task must complete");
}
}
}
Expand Down Expand Up @@ -365,7 +365,7 @@ private void VerifyResult(TaskInfo current)
{
//this means that the task was not scheduled - it was cancelled or it is still in the queue
//-42 = UNINITIALED_RESULT
Assert.Fail(string.Format("Result must remain uninitialized for unstarted task"));
Assert.Fail("Result must remain uninitialized for unstarted task");
}
else if (ti.Task.IsCompleted)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ private static void CheckForCorrectCT(Task canceledTask, CancellationToken corre
try
{
canceledTask.Wait();
Assert.Fail(string.Format(" > FAILED! Pre-canceled result did not throw from Wait()"));
Assert.Fail(" > FAILED! Pre-canceled result did not throw from Wait()");
}
catch (AggregateException ae)
{
Expand All @@ -866,11 +866,11 @@ private static void CheckForCorrectCT(Task canceledTask, CancellationToken corre
var tce = e as TaskCanceledException;
if (tce == null)
{
Assert.Fail(string.Format(" > FAILED! Pre-canceled result threw non-TCE from Wait()"));
Assert.Fail(" > FAILED! Pre-canceled result threw non-TCE from Wait()");
}
else if (tce.CancellationToken != correctToken)
{
Assert.Fail(string.Format(" > FAILED! Pre-canceled result threw TCE w/ wrong token"));
Assert.Fail(" > FAILED! Pre-canceled result threw TCE w/ wrong token");
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ public static void RunContinueWhenAnyTests()
{
if (ex == null)
{
Assert.Fail(string.Format("RunContinueWhenAnyTests: > FAILED! Expected AE<TCE> from continuation.Wait() (no exception thrown)"));
Assert.Fail("RunContinueWhenAnyTests: > FAILED! Expected AE<TCE> from continuation.Wait() (no exception thrown)");
;
}
else if (ex.GetType() != typeof(AggregateException))
{
Assert.Fail(string.Format("RunContinueWhenAnyTests: > FAILED! Expected AE<TCE> from continuation.Wait() (didn't throw aggregate exception)"));
Assert.Fail("RunContinueWhenAnyTests: > FAILED! Expected AE<TCE> from continuation.Wait() (didn't throw aggregate exception)");
}
else if (((AggregateException)ex).InnerException.GetType() != typeof(TaskCanceledException))
{
Expand Down Expand Up @@ -490,7 +490,7 @@ private static void CheckForCorrectCT(Task canceledTask, CancellationToken corre
try
{
canceledTask.Wait();
Assert.Fail(string.Format(" > FAILED! Pre-canceled result did not throw from Wait()"));
Assert.Fail(" > FAILED! Pre-canceled result did not throw from Wait()");
}
catch (AggregateException ae)
{
Expand All @@ -499,11 +499,11 @@ private static void CheckForCorrectCT(Task canceledTask, CancellationToken corre
var tce = e as TaskCanceledException;
if (tce == null)
{
Assert.Fail(string.Format(" > FAILED! Pre-canceled result threw non-TCE from Wait()"));
Assert.Fail(" > FAILED! Pre-canceled result threw non-TCE from Wait()");
}
else if (tce.CancellationToken != correctToken)
{
Assert.Fail(string.Format(" > FAILED! Pre-canceled result threw TCE w/ wrong token"));
Assert.Fail(" > FAILED! Pre-canceled result threw TCE w/ wrong token");
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ internal void RealRun()

// check continuation is non-blocking, i.e., it does not block until all/one tasks finish
if (_continuation.Status != TaskStatus.WaitingForActivation)
Assert.Fail(string.Format("continuation task should be created when none task finish"));
Assert.Fail("continuation task should be created when none task finish");

// allow continuation to kick off later
foreach (Task t in _tasks)
Expand Down Expand Up @@ -448,7 +448,7 @@ private void VerifyAllT(Task<double>[] inputTasks)
private void VerifyAny(Task inputTask)
{
if (!inputTask.IsCompleted)
Assert.Fail(string.Format("ContinueWhenAny contract is broken -- none task has completed"));
Assert.Fail("ContinueWhenAny contract is broken -- none task has completed");

// do the sanity check against the input task

Expand All @@ -464,7 +464,7 @@ private void VerifyAny(Task inputTask)
}

if (!found)
Assert.Fail(string.Format("input task do not exist in the expected original tasks"));
Assert.Fail("input task do not exist in the expected original tasks");

Verify();
}
Expand All @@ -473,7 +473,7 @@ private void VerifyAny(Task inputTask)
private void VerifyAnyT(Task<double> inputTask)
{
if (!inputTask.IsCompleted)
Assert.Fail(string.Format("ContinueWhenAny contract is broken -- none task has completed"));
Assert.Fail("ContinueWhenAny contract is broken -- none task has completed");

// do the sanity check against the input task

Expand All @@ -490,7 +490,7 @@ private void VerifyAnyT(Task<double> inputTask)
}

if (!found)
Assert.Fail(string.Format("input task do not exist in the expected original tasks"));
Assert.Fail("input task do not exist in the expected original tasks");

Verify();
}
Expand Down Expand Up @@ -568,7 +568,7 @@ private void Verify()

//else if (ti.Thread == null && result != -1)
//{
// Assert.Fail(string.Format("Result must remain uninitialized for unstarted task"));
// Assert.Fail("Result must remain uninitialized for unstarted task");
//}
}
}
Expand Down
Loading
Loading