Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Add tests for WritableBuffer extensions and rename WriteAscii => WriteAsciiNoValidation #1553

Merged
merged 1 commit into from
Mar 29, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -7772,7 +7772,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 17, 14);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7798,7 +7798,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 31, 8);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7819,7 +7819,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 133, 16);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7845,7 +7845,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 350, 10);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand Down Expand Up @@ -7877,7 +7877,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 0, 17);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7898,7 +7898,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 39, 14);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7919,7 +7919,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 53, 10);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7940,7 +7940,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 63, 11);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7966,7 +7966,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 74, 21);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -7987,7 +7987,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 95, 11);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8008,7 +8008,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 106, 7);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8029,7 +8029,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 113, 11);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8050,7 +8050,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 124, 9);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8071,7 +8071,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 149, 20);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8092,7 +8092,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 169, 20);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8113,7 +8113,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 189, 20);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8134,7 +8134,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 209, 15);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8155,7 +8155,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 224, 17);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8176,7 +8176,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 241, 11);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8197,7 +8197,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 252, 17);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8218,7 +8218,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 269, 17);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8239,7 +8239,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 286, 7);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8260,7 +8260,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 293, 8);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8281,7 +8281,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 301, 12);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8302,7 +8302,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 313, 22);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8323,7 +8323,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 335, 15);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8344,7 +8344,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 360, 14);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8365,7 +8365,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 374, 8);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8386,7 +8386,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 382, 20);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8407,7 +8407,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 402, 36);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8428,7 +8428,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 438, 32);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8449,7 +8449,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 470, 32);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8470,7 +8470,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 502, 31);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8491,7 +8491,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 533, 33);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand All @@ -8512,7 +8512,7 @@ protected void CopyToFast(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_headerBytes, 566, 26);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void CopyTo(ref WritableBuffer output)
if (value != null)
{
output.WriteFast(_CrLf);
output.WriteAscii(kv.Key);
output.WriteAsciiNoValidation(kv.Key);
output.WriteFast(_colonSpace);
output.WriteAscii(value);
output.WriteAsciiNoValidation(value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,15 @@ private static unsafe void WriteMultiBuffer(this WritableBuffer buffer, byte[] s
}
}

public unsafe static void WriteAscii(this WritableBuffer buffer, string data)
/// <summary>
/// Write string characters as ASCII without validating that characters fall in the ASCII range
/// </summary>
/// <remarks>
/// ASCII character validation is done by <see cref="FrameHeaders.ValidateHeaderCharacters(string)"/>
/// </remarks>
/// <param name="buffer">the buffer</param>
/// <param name="data">The string to write</param>
public unsafe static void WriteAsciiNoValidation(this WritableBuffer buffer, string data)
{
if (string.IsNullOrEmpty(data))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<Compile Include="..\shared\**\*.cs" />
<Content Include="..\shared\TestResources\testCert.pfx" CopyToOutputDirectory="PreserveNewest" />
<None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "http://json.schemastore.org/xunit.runner.schema",
"methodDisplay": "method",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to display as Class.Method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish. There are only two options. "classAndMethod" and "method". The former is the default and is what results in the massively long test names in Test Explorer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😞

"longRunningTestSeconds": 60
}
Loading