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 eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
<!-- Opt-in/out repo features -->
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
<!-- TODO: Upgrade compiler version to enable Static Abstracts in Interfaces; remove this once the employed SDK uses a new enough version. -->
<MicrosoftNetCompilersToolsetVersion>4.0.0-2.21323.11</MicrosoftNetCompilersToolsetVersion>
<!-- TODO: Upgrade compiler version to enable Static Abstracts in Interfaces and interpolated string handlers; remove this once the employed SDK uses a new enough version. -->
<MicrosoftNetCompilersToolsetVersion>4.0.0-3.21362.7</MicrosoftNetCompilersToolsetVersion>
<UsingToolMicrosoftNetILLinkTasks>true</UsingToolMicrosoftNetILLinkTasks>
<UsingToolIbcOptimization>false</UsingToolIbcOptimization>
<UsingToolXliff>false</UsingToolXliff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static async Task ProcessWebSocketRequest(
await socket.CloseAsync(
closeStatus,
replyWithEnhancedCloseMessage ?
$"Server received: {(int)closeStatus} {receiveResult.CloseStatusDescription}" :
("Server received: " + (int)closeStatus + " " + receiveResult.CloseStatusDescription) :
receiveResult.CloseStatusDescription,
CancellationToken.None);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public static void Invoke(HttpContext context)
if (statusCode < 300 || statusCode > 308)
{
context.Response.StatusCode = 400;
context.Response.SetStatusDescription($"Invalid redirect statuscode: {statusCodeString}");
context.Response.SetStatusDescription("Invalid redirect statuscode: " + statusCodeString);
return;
}
}
catch (Exception)
{
context.Response.StatusCode = 400;
context.Response.SetStatusDescription($"Error parsing statuscode: {statusCodeString}");
context.Response.SetStatusDescription("Error parsing statuscode: " + statusCodeString);
return;
}
}
Expand All @@ -36,7 +36,7 @@ public static void Invoke(HttpContext context)
if (string.IsNullOrEmpty(redirectUri))
{
context.Response.StatusCode = 400;
context.Response.SetStatusDescription($"Missing redirection uri");
context.Response.SetStatusDescription("Missing redirection uri");
return;
}

Expand All @@ -51,7 +51,7 @@ public static void Invoke(HttpContext context)
catch (Exception)
{
context.Response.StatusCode = 400;
context.Response.SetStatusDescription($"Error parsing hops: {hopsString}");
context.Response.SetStatusDescription("Error parsing hops: " + hopsString);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void Invoke(HttpContext context)
catch (Exception)
{
context.Response.StatusCode = 400;
context.Response.SetStatusDescription($"Error parsing statuscode: {statusCodeString}");
context.Response.SetStatusDescription("Error parsing statuscode: " + statusCodeString);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ private static string GetVersionInfo()
FileVersionInfo fi = FileVersionInfo.GetVersionInfo(path);

var buffer = new StringBuilder();
buffer.AppendLine($"Information for: {Path.GetFileName(path)}");
buffer.AppendLine($"Location: {Path.GetDirectoryName(path)}");
buffer.AppendLine($"Framework: {RuntimeInformation.FrameworkDescription}");
buffer.AppendLine($"File Version: {fi.FileVersion}");
buffer.AppendLine($"Product Version: {fi.ProductVersion}");
buffer.AppendLine($"Creation Date: {File.GetCreationTime(path)}");
buffer.AppendLine($"Last Modified: {File.GetLastWriteTime(path)}");
buffer.AppendLine("Information for: " + Path.GetFileName(path));
buffer.AppendLine("Location: " + Path.GetDirectoryName(path));
buffer.AppendLine("Framework: " + RuntimeInformation.FrameworkDescription);
buffer.AppendLine("File Version: " + fi.FileVersion);
buffer.AppendLine("Product Version: " + fi.ProductVersion);
buffer.AppendLine("Creation Date: " + File.GetCreationTime(path));
buffer.AppendLine("Last Modified: " + File.GetLastWriteTime(path));

return buffer.ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static bool HandleAuthentication(HttpContext context)
else if (authType != null)
{
context.Response.StatusCode = 501;
context.Response.SetStatusDescription($"Unsupported auth type: {authType}");
context.Response.SetStatusDescription("Unsupported auth type: " + authType);
return false;
}

Expand All @@ -57,14 +57,14 @@ private static bool HandleBasicAuthentication(HttpContext context, string user,
if (split.Length < 2)
{
context.Response.StatusCode = 500;
context.Response.SetStatusDescription($"Invalid Authorization header: {authHeader}");
context.Response.SetStatusDescription("Invalid Authorization header: " + authHeader); ;
return false;
}

if (!string.Equals("basic", split[0], StringComparison.OrdinalIgnoreCase))
{
context.Response.StatusCode = 500;
context.Response.SetStatusDescription($"Unsupported auth type: {split[0]}");
context.Response.SetStatusDescription("Unsupported auth type: " + split[0]);
return false;
}

Expand Down Expand Up @@ -106,8 +106,7 @@ private static bool HandleChallengeResponseAuthentication(

// We don't fully support this authentication method.
context.Response.StatusCode = 501;
context.Response.SetStatusDescription(
$"Attempt to use unsupported challenge/response auth type. {authType}: {authHeader}");
context.Response.SetStatusDescription("Attempt to use unsupported challenge/response auth type. " + authType + ": " + authHeader);

return false;
}
Expand Down
30 changes: 9 additions & 21 deletions src/libraries/System.Console/tests/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,17 @@ public static void SetAndReadHelper(Action<TextWriter> setHelper, Func<TextWrite

try
{
using (MemoryStream memStream = new MemoryStream())
{
using (StreamWriter sw = new StreamWriter(memStream))
{
setHelper(sw);
var memStream = new MemoryStream();
var sw = new StreamWriter(memStream);
setHelper(sw);

TextWriter newStream = getHelper();
TextWriter newStream = getHelper();
Assert.NotNull(newStream);
newStream.Write(TestString);
newStream.Flush();

Assert.NotNull(newStream);

newStream.Write(TestString);
newStream.Flush();

memStream.Seek(0, SeekOrigin.Begin);

using (StreamReader sr = new StreamReader(memStream))
{
string fromConsole = readHelper(sr);

Assert.Equal(TestString, fromConsole);
}
}
}
memStream.Seek(0, SeekOrigin.Begin);
Assert.Equal(TestString, readHelper(new StreamReader(memStream)));
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public static async Task Generic_UsedWithAsyncMethod_CompletesSuccessfully(int y
Assert.Equal(42 + yields, await ValueTaskReturningAsyncMethod(42));
Assert.Equal(84 + yields, await ValueTaskReturningAsyncMethod(84));

[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<int>))]
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))]
async ValueTask<int> ValueTaskReturningAsyncMethod(int result)
{
for (int i = 0; i < yields; i++)
Expand Down Expand Up @@ -440,7 +440,7 @@ async ValueTask ValueTaskReturningMethod()
}
}

[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<int>))]
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))]
async ValueTask<int> ValueTaskInt32ReturningMethod()
{
for (int i = 0; i < 3; i++)
Expand Down Expand Up @@ -499,7 +499,7 @@ await Task.WhenAll(Enumerable.Range(0, Environment.ProcessorCount).Select(async
{
Assert.Equal(42 + i, await ValueTaskAsync(i));

[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<int>))]
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))]
static async ValueTask<int> ValueTaskAsync(int i)
{
await Task.Delay(1);
Expand Down Expand Up @@ -549,7 +549,7 @@ public void PoolingAsyncValueTasksBuilder_ObjectsPooled(string limitEnvVar)
Assert.InRange(boxes.Distinct().Count(), 1, boxes.Count - 1);
}, new RemoteInvokeOptions() { StartInfo = psi }).Dispose();

[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<int>))]
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))]
static async ValueTask<int> ComputeAsync(int input, ConcurrentQueue<object> boxes)
{
await RecursiveValueTaskAsync(3, boxes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Reflection;
using System.Reflection.Emit;
Expand Down Expand Up @@ -218,7 +219,7 @@ public static void GetLoadContextForDynamicAssembly(bool isCollectible)
assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndCollect);
}

AssemblyLoadContext? context = AssemblyLoadContext.GetLoadContext(assemblyBuilder);
AssemblyLoadContext context = AssemblyLoadContext.GetLoadContext(assemblyBuilder);

Assert(context != null);
Assert(alc == context);
Expand Down
3 changes: 3 additions & 0 deletions src/tests/profiler/eventpipe/eventpipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Profiler.Tests;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.Tracing;
Expand Down Expand Up @@ -35,6 +36,8 @@ public static int Main(string[] args)

public static int RunTest()
{
ArrayPool<char>.Shared.Rent(1); // workaround for https://github.com/dotnet/runtime/issues/1892

bool success = true;
int allTypesEventCount = 0;
int arrayTypeEventCount = 0;
Expand Down