Browse Source

[SL.Core] Add test to ensure PointF has the same layout as Vector2

pull/1087/head
Jason Nelson 8 years ago
parent
commit
e154df4654
  1. 12
      tests/SixLabors.Core.Tests/Primitives/PointFTests.cs

12
tests/SixLabors.Core.Tests/Primitives/PointFTests.cs

@ -5,12 +5,24 @@ using System;
using System.Globalization;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using Xunit;
namespace SixLabors.Primitives.Tests
{
public class PointFTests
{
[Fact]
public void CanReinterpretCastFromVector2()
{
var vector = new Vector2(1, 2);
PointF point = Unsafe.As<Vector2, PointF>(ref vector);
Assert.Equal(vector.X, point.X);
Assert.Equal(vector.Y, point.Y);
}
[Fact]
public void DefaultConstructorTest()
{

Loading…
Cancel
Save