Skip to content

Commit

Permalink
Fix be test #2 (dotnet#86323)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed May 16, 2023
1 parent 41274d0 commit eb983f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ public static void ReadOnlySpanGetReferenceAndReadInteger()
Assert.Equal(BitConverter.IsLittleEndian ?
0x65_00_68 :
0x68_00_65,
Unsafe.As<byte, int>(ref Unsafe.Add(ref Unsafe.As<char, byte>(
Unsafe.ReadUnaligned<int>(ref Unsafe.Add(ref Unsafe.As<char, byte>(
ref MemoryMarshal.GetReference("hello world 1".AsSpan())), 0)));

Assert.Equal(BitConverter.IsLittleEndian ?
0x6F_00_6C_00_6C_00_65_00 :
0x00_65_00_6C_00_6C_00_6F,
Unsafe.As<byte, long>(ref Unsafe.Add(ref Unsafe.As<char, byte>(
0x68_00_65_00_6C_00_6C_00,
Unsafe.ReadUnaligned<long>(ref Unsafe.Add(ref Unsafe.As<char, byte>(
ref MemoryMarshal.GetReference("hello world 2".AsSpan())), 1)));
}
}
Expand Down

0 comments on commit eb983f2

Please sign in to comment.